You need to correct some things for internationalization
-
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.www.remarpro.com 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]
- The topic ‘You need to correct some things for internationalization’ is closed to new replies.