Support » Plugin: Folders - Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager » You need to correct some things for internationalization

  • ResolvedModerator tobifjellner (Tor-Bjorn Fjellner)

    (@tobifjellner)


    Hi,

    In order for localization of your plugin to work correctly, you need to use a different text-domain in your plugin.

    Here’s an example:
    <div class="remove-folder-note"><?php echo sprintf(esc_html__("Folders will remove all created folders once you remove the plugin. We recommend you %s if you plan to use Folders in future.", WCP_FOLDER), "<b>".esc_html__("not to use this feature", WCP_FOLDER)."</b>"); ?></div>

    Where you’re using the string “WCP_FOLDER”, you need to use the slug of your plugin, “folders”. (You’re already declaring the right text-domain in you main PHP, so this would be the last to to ensuring that translations will load correctly.

    Then I stumbled upon another problem. At least in the line I copied above, but perhaps in more places, you’re gluing together parts of strings in a way that can get very tricky to translate, since the context gets lost.
    Better: just place the tags using printf.
    Best: Leave the those <b> tags in the string itself. Some languages don’t even use italics nor bold (Japanese, for instance). Obviously then you can strip the html, but I assure you that people who translate WordPress are in general good at handling that kind of tags, and our translation platform translate.wordpress.org will even throw a warning if html tags are mismatched between source and target.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Gal Dubinski

    (@galdub)

    @tobifjellner thanks for the feedback šŸ™‚

    We’re working on a new release, we’ll take care of your suggestions once we launch it

    Plugin Author Gal Dubinski

    (@galdub)

    Fixed šŸ™‚

    darsonkeiran

    (@darsonkeiran)

    Just a quick note that this helped me figure out a problem I was having. I’m not sure it’s related to this, so I’ll make a thread elsewhere, but I’ll briefly mention it here since Gal is involved already on this.

    I am using a plugin called Polylang for 2 language front end view.

    The second language is Chinese.

    I noticed that when the language of the page was set to Chinese, I went to change an image in the back end, WP was unable to see any of the images in folders. I currently have 1103 images, 31 not in folders. I left the demo images in place while I’m working on building the site. There’s 342 images from that demo install. And sure enough, when I clicked on the “All Images”, instead of loading 1103 images, it loaded 352 images. These would be the original images. Plus 10 more… Not sure why there’s a mismatch there.

    Choosing any folder would just show no images.

    When I found this thread, I tried it out and switched the language of the page to English again and suddenly the pics showed up again.

    This thread is showing as fixed 5 months ago and my version (2.7.1) is currently up to date, showing 3 weeks ago as last updated.

    So there’s still something that needs attention I guess.

    @darsonkeiran You’re totally right: much better to start your own topic at https://wordpress.org/support/plugin/folders/
    I’ll close this thread for further replies.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘You need to correct some things for internationalization’ is closed to new replies.