translation
-
I’m now trying to work on translating this plugin for one of my websites. I added a “languages” directory under the plugin directory. I pulled out translatable strings with poEdit and translated the registration form-related strings I wanted and uploaded my join-my-multisite-{languagecode}_{countrycode}.po and .mo files to the languages directory.
In joinmymultisite.php, there seems to be a line that pulls in translations, line 59:
load_plugin_textdomain( 'helfjmm', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
But this is in the add_settings_page() function. I tried to copy this line into the init() function with no results.How do I load my translation for this plugin?
=====
I just figured it out while writing this post, the translation files need to be named helfjmm-{languagecode}_{countrycode}.po not join-my-multisite-{languagecode}_{countrycode}.po
To summarize, the steps needed are:
1) Create a “languages” subdirectory under the plugin directory
2) Create translations and name them helfjmm-{languagecode}_{countrycode}.po and helfjmm-{languagecode}_{countrycode}.mo and upload them to the “languages” subdirectory
3) add the lineload_plugin_textdomain( 'helfjmm', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );to the end of the init() function in joinmymultisite.phpCheers!
The topic ‘translation’ is closed to new replies.