custom theme: english .mo file not working

I’m having an issue with a .mo file.

I have a fully functioning localized custom theme that’s running in four languages for the moment: Dutch, English, French and Spanish. There is one problem: the English localization doesn’t work. The other languages work just fine.

Read More

The translation plugin is polylang.
The plugin for creating .po and .mo files is CodeStyling Localization.

The .po and .mo files are situated in the folder /language/ inside my theme.

The theme is localized and works just fine in Dutch (default language), French and Spanish. When I’m in the English version of the website however, the default Dutch words appear on localized strings.

I’ve tried deleting the English .mo and .po files and recreating them anew but this didn’t help.
It isn’t a problem with the en_US.po or en_US.mo files. I just copied them from the site’s server and tried them on another WP install. Worked just fine.

I’m out of ideas. Does anybody have suggestions? Is there a way to test the call to the English .mo file and get some PHP feedback. Any ideas are welcome.

Related posts

2 comments

  1. My suggestions:

    1. Check language of the wordpress settings, it must be Dutch.
    2. Disable the plugin just upload .mo files in /languages/.
    3. You must check your theme! Maybe overriding default language is the problem! or …
  2. By default WordPress is in English (en_US) and all texts are as well. I believe that translating isn’t done for that locale.
    You could change your English locale to en_GB but I’d advice to make it a habit of using English (en_US) text in your themes/plugins by default. This way its always in sync with WP core and other plugins. You can do all other languages with translation files.

    Also, just a nice tip, check Loco Translate: https://nl.wordpress.org/plugins/loco-translate/

Comments are closed.