• Resolved Peter_L

    (@peter_l)


    Hello,

    I’m having a problem with localization.

    A website of mine is available in 4 languages: nl (default), fr, en and es. Everything works fine except for the localization in English. It’s doesn’t translate the localized string in English (en_US.mo) but instead uses the default Dutch. The other languages’ .mo files work just fine.

    To create the theme’s .po and .mo files I used Codestyling Localization plugin. I pulled the en_US.mo file from the server and tried it on another server and it worked just fine. Same for the entire theme. So, I’m thinking the problem must be elsewhere.

    Other things I tried are: deleting and recreating the english .po and .mo files, removing the Codestyling Localization plugin and the theme language folder, reinstalling the plugin and recreating.

    I’m at a loss. Currently, I’m thinking a the client might have done something wrong while creating the language (through polylang) and that is causing the problem. How could I verify this?

    Do you have any other ideas what might be causing this?

    http://wordpress.org/plugins/polylang/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Chouby

    (@chouby)

    Why do you need an en_US.mo file?

    Thread Starter Peter_L

    (@peter_l)

    Because my theme template files contain some text strings that need translation and the default language is Dutch, not English.
    __('Dutch text', 'theme name')

    Plugin Author Chouby

    (@chouby)

    That’s probably the source of your issue. By default, WordPress supposes that everything is written in ‘en_US’ and it loads translations for other languages.

    In Polylang languages, could you try to change the English locale to ‘en_GB’ instead of ‘en_US’ and rename your theme localization file from ‘en_US.mo’ to ‘en_GB.mo’?

    Thread Starter Peter_L

    (@peter_l)

    Yes, this solved it.

    In polylang, I changed locale to en_GB.

    Then I deleted the en_US.mo from my theme language folder and renamed the en_US.po to en_GB.po. Then I opened my codestyling localization plugin and created the en_GB.mo file. (little detour to keep edibility in the codestyling plugin on the english theme language file).

    Thank you very much! Really appreciate your help.

    As for,

    That’s probably the source of your issue. By default, WordPress supposes that everything is written in ‘en_US’ and it loads translations for other languages.

    I’m not sure because I usually use a Dutch install of WordPress, so that should’ve had the default on nl_NL.
    http://nl.wordpress.org/
    But I could’ve ‘accidently’ used the US version as well. Can’t remember.

    Plugin Author Chouby

    (@chouby)

    You are right. I checked and Polylang assumes in one place that the default locale is en_US. That’s may be the source of your issue. I made that to save some time but I may have to reconsider this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘localization problem with .mo file.’ is closed to new replies.