• Resolved BIRD_GS

    (@bird_gs)


    Hi,
    Plugin to translate : “WPPIZZA” version 2.15.0.19
    Try to translate in French by adding a new translation but following error message is displayed:
    Erreur: Invalid MO format
    Language files already available in plugin “lang” directory:
    – wppizza-locale-nl_NL.po + mo
    – wppizza-locale-it_IT.po + mo
    – wppizza-locale-he_IL.po + mo
    – wppizza-locale-es_ES.po + mo
    – wppizza-locale-en_GB.po + mo
    – wppizza-locale-de_DE.po + mo
    Strange is that no (PO) files are listed into “Loco Translate” and under (POT) “wppizza-locale-en_GB.mo” is shown for this “WPPIZZA” plugin.
    What’s the issue ?
    Thank’s

    https://www.ads-software.com/plugins/loco-translate/

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

    (@timwhitlock)

    Loco is falling back to the MO file as a template because the plugin has no POT file. A ‘solution’ that causes more problems in some cases and will be scrapped in version 2.

    However, it should still work. I just installed wppizza and had no problem adding another language.

    You could copy the en_GB.po file to wppizza-locale.pot to fix it, but really this is for the author to do. plugin updates will overwrite it if you do it yourself.

    Thread Starter BIRD_GS

    (@bird_gs)

    Ok thank for you answer.

    The copy .po to .pot solve the problem with “Invalid MO format”.
    Now I can add a new a new translation, but:
    – Other language are always not listed.
    – Don’t work on global directory.
    – If I use my file translated with Poedit, Loco translate see it and can edit it but no result on Plugin !!!

    It work only if the file is created from begin with Loco Translate locally in the plugin but translation is marked 100% done even if nothing was done.

    Plugin Author Tim W

    (@timwhitlock)

    Your problems are very unclear. Can you be more specific please?

    Other language are always not listed

    Other than what? Listed where?

    Don’t work on global directory.

    In what way? Do you get an error? Did you set correct permissions? Are you expecting existing files to move there automatically? Are you saying files in there don’t show in Loco?

    If I use my file translated with Poedit, Loco translate see it and can edit it but no result on Plugin !!!

    Are the files named correctly and in the right location? Is your WordPress language set correctly?

    It work only if the file is created from begin with Loco Translate

    The plugin will work with existing files as long as they’re in the right place with the right names. I can’t account for the correctness of anything you’ve edited offline and uploaded.

    translation is marked 100% done even if nothing was done.

    In the editor view or the main screen? Are you saying empty files show as translated?

    Thread Starter BIRD_GS

    (@bird_gs)

    Sorry if unclear but I begin to understand.

    There is a mismatch between what are listed in your plugin and the file really used by the plugin WPPIZZA.

    “Loco Translate” is pointing and editing file present in ‘lang’ rep of the plugin (../wp-content/plugins/wppizza/lang) and WordPress use file present in global language rep (../wp-content/languages/plugins).

    Something else, WPPIZZA use language file named like “wppizza-locale-xx_XX.po/mo” and “Loco Translate” use file like “wppizza-xx_XX.po/mo”.

    Conclusion, WPPIZZA don’t use language file edited and listed into “Loco Translate”.

    Plugin Author Tim W

    (@timwhitlock)

    Ok, yes I see that Loco is still guessing the Text Domain wrongly.

    Change the plugin header to declare the text domain like this:

    <?php
    /*
    Plugin Name: WPPizza
    Text Domain: wppizza-locale
    Domain Path: /lang/
    ...

    If you have any existing PO/MO files with the wrong name, just rename them.

    Thread Starter BIRD_GS

    (@bird_gs)

    Ok, it’s really better so.

    Now, after updates, I do not forget to change this header.

    Thank’s for your help.
    great job !

    Plugin Author Tim W

    (@timwhitlock)

    It’s worth asking the plugin author to add it to their next release, and ideally ship a POT file too. They’re not obliged to, but they might want to make it more compatible with other translation software.

    Thread Starter BIRD_GS

    (@bird_gs)

    right

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WPPIZZA plugin translation – Invalid MO format’ is closed to new replies.