How to use I18N for plugin?
-
Hello,
I’m writing a small plugin (called wp-version on the wordpress plugins repository) and want to internationalize it. I follow all the steps in the I18N page, but obviously I miss something. I also looked how other plugin do, but it still doesn’t work for me.What I do :
– I used _e(XXX, “domain name”) for all the string I want to translate
– I used the www.ads-software.com repository to generate the .pot file
– I used POEdit to generate the fr-FR.po and fr-FR.mo filled with translations.
– I added in my main plugin file :function wp_version_init() { $wp_version_domain = 'wp-version'; load_plugin_textdomain ( $wp_version_domain,'','wp-version/lang/'); } add_action('init', 'wp_version_init');
I found this way to proceed on another plugin. Is this OK?
THen, when I activate my plugin on my french wordpress, it works but everything is displayed in english (the langage I used in the _e() commands). So I don’t see what I do wrong.
I’m fighting with that for a long time now, any help or suggestion would be deeply appreciated !!!
Many thanks to everybody.
Nixar
- The topic ‘How to use I18N for plugin?’ is closed to new replies.