Quick Question About Internationalizing
-
I’m currently going through the steps of internationalizing my plugin. I’ve read through these two links which were of intense value to me:
https://codex.www.ads-software.com/Writing_a_Plugin#Internationalizing_Your_Plugin
https://urbangiraffe.com/articles/translating-wordpress-themes-and-plugins/I’ve created a .POT file and as a test example I’ve created an English to 1337 (1337 is leet and basically replaces letters with numbers, as I say it’s just an example) .mo file called wplinkdir-en_UK.1337.mo
From what I can gather the plugin should adopt whichever .mo file is in the directory and use it, but this isn’t the case and my plugin currently functions as normal, displaying all text in English.
My initiation function looks like this:
$WPLD_Domain = 'wplinkdir'; $WPLD_Translation_isSetup = 0; function wplinkdir_translation_setup(){ global $WPLD_Domain, $WPLD_Translation_isSetup; if($WPLD_Translation_isSetup) { return; } load_plugin_textdomain($WPLD_Domain, PLUGINDIR.'/'.dirname(plugin_basename(__FILE__)), dirname(plugin_basename(__FILE__))); }
Which was copied straight from the codex. As I say, the plugin fails to translate. I think I’m overlooking something but I can’t figure out where.
- The topic ‘Quick Question About Internationalizing’ is closed to new replies.