Problems with plugin translation


I did follow the official guidelines to produce a translation into french for a plugin: Internationalization — Omeka 2.7 documentation

But the plugin won’t show the translations. I wonder if there is anything that could stop the code in this plugin from using translations altough I see that it contains the __ php function to mark words to translate.

Anyone did work in translations for plugins in here and that could help giving me some troubleshooting guidelines?

The plugin I worked in is : AvantSearch


Hello, Pablo.

Your issue could originate in many places, but I would first check that the main plugin file (AvantSearchPlugin.php) contains the following line inside public function hookInitialize():

add_translation_source(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'languages');

If that’s the case, then make sure that your .po files are respecting the correct syntax, then that you’ve created the .mo files and that these last ones are copied inside the languages folder of the plugin. Finally, clear the cache and everything should work…

Hope this helps.

I added that line

add_translation_source(dirname(FILE) . DIRECTORY_SEPARATOR . ‘languages’);

and it is working now. Thanks a million!

Glad it worked, Pablo :slight_smile:

If you have a working translation in French for the plugin, and you’d like to make it available for other users as well, I bet the plugin’s creator @gsoules could maybe include it in a future release, so you might get in touch with him to check what’s the best way to submit it (I’d guess, a pull request on GitHub from you own fork of the plugin).

This topic was automatically closed after 250 days. New replies are no longer allowed.