• Resolved dingdang

    (@dingdang)


    Hello,

    using this plugin is there a way to “translate” the default language – let say it is en_US – to have pluginname-en_US.mo and .po files and to be able to update texts there and NOT in the plugin code?

    Currently it detects the other language files but not the default one (the files are present). While having po/mo for en_US works well in WordPress and it replaces strings used in the code with those from the .mo file even when it is the default English language.

    https://ww.wp.xz.cn/plugins/loco-translate/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Tim W

    (@timwhitlock)

    What plugin are you translating?

    Does it contain a POT file?

    Hi Tim, I’m glad you gave that answer for I was searching for a solution. I translated my strings in the default.po, hit the save button, then synced. Since then I don’t have a default.po anymore only a theme.pot file which I cannot edit. Can you tell me what to do?
    I deinstalled Loco translate and reinstalled it, but that didn’t change anything. Hope you can help. Thanks in advance, Dagmar/Dagvanmorgen

    Plugin Author Tim W

    (@timwhitlock)

    @dagvanmorgen Please open a new thread for a new question.

    Thread Starter dingdang

    (@dingdang)

    Hello Tim,

    yes (about the .pot). In case there is no .pot, in the column “Template (POT)” appears the en_US.mo file.

    When I upload the .pot file in that column appear both en_US.mo and .pot file.

    The other two languages correctly appear in “Translations (PO)” column.

    So I see that the default WP languages (which is en_US) is not taken as a language for translation for some reason.

    To summarize: I have 3 languages, each with .po and .mo files, one .pot, WP with default lang set to en_US, one of the above languages is en_US, too. I’d like to be able to edit three of them, not just the two that are different from the default WP lang. The reason is to avoid editing later the texts in the plugin, but in the external .po/.mo files.

    Thread Starter dingdang

    (@dingdang)

    Hello Tim,

    I resolved my problem. The .pot file SHOULD have -en_US in it. After I renamed it, now only the .pot file is in the “POT” column, the en_us.mo is now a language for translation.

    I’d recommend (if the above is not a convention, but I guess it is not as dozen plugins I have installed have .pot files not containing en_US):

    – if there is .pot file, to use any, not just ending with en_US (matching the WP lang)
    – not to treat en_US.mo as a POT file in that case.

    Thank you, I am marking this as solved.

    Plugin Author Tim W

    (@timwhitlock)

    A POT file shouldn’t contain a locale code. it should be named the same as the text domain, e.g. mytheme.pot This is standard and will provide the best results using Loco Translate.

    But regardless of this naming, the mess you encountered is because Loco tries to work with themes that are set up unconventionally. Using a MO file as a template is a desperate last attempt to work with a theme, and I will be scrapping it.

    The next major version of the plugin (2.0) won’t do any such “guessing”. Any non-standard set up will have to be configured manually. It’s the only way to handle weird setups without causing even more problems.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘"Translate" the default language’ is closed to new replies.