Support » Plugin: Loco Translate » Traduction impossible

  • Bonjour, j’ai traduit toutes les chaînes (99.2 %) avec Loco Translate de mon plugin Directorist de l’anglais vers le français. J’ai bien le fichier .POT dans le dossier wp content/plugins/directorist et enregistré mes fichiers .mo et .po dans wp content/languages/plugins mais malgré cela certaines traductions ne se font pas. J’ai tout essayé : changer les fichiers .mo et .po de place, vider le cache… Merci de votre aide !
    Hello, I translated all the strings (99.2%) with Loco Translate of my Directorist plugin from English to French. The .POT file is in wp content/plugins/directorist folder and I have saved my .mo and .po files in wp content/languages/plugins. But some translations are not done. I’ve tried everything possible : relocate the .po and .mo, empty cache… Thank your for your help !

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

    (@timwhitlock)

    The .POT file is in wp content/plugins/directorist folder and I have saved my .mo and .po files in wp content/languages/plugins. But some translations are not done.

    As with any PO file editor, Loco Translate’s job is to take source strings from directorist.pot and allow you to save the file directorist-fr_FR.mo. If this is working then your problem displaying translations is unlikely to be the fault of the editor that saved the file.

    As the plugin is open source (https://wordpress.org/plugins/directorist/) I can have a look if you tell me which string is not working for you.

    Plugin Author Tim W

    (@timwhitlock)

    I have spotted a likely cause.

    This plugin’s PHP source files have DOS line breaks. This is a problem for multi-line translations as they will never be matched when reading MO files. The solution is to fix all PHP files to use Unix line breaks, but this would just get reverted when the plugin is updated.

    I recommend reporting this as a bug to the developer instead and wait for an update. They are free to ship their code with DOS line breaks if they like, but if they want their multi-line strings to work with PO file editors then they should avoid it.

    Thread Starter melisetcom

    (@melisetcom)

    Thanks, most of the chains have been translated. Maybe 98 % or even more. If the problem was the “line breaks”, they couldn’t have been translated at all ? The back-end is all right. The translations undone are on the front-end. How can I show/tell you wich ones ?
    I’d like also help the community by sharing my .mo file “french translation” but I don’t know how to do ? Sorry for my English… I’will report this to the developer, thanks.

    • This reply was modified 3 months, 2 weeks ago by melisetcom.
    Plugin Author Tim W

    (@timwhitlock)

    most of the chains have been translated. Maybe 98 % or even more. If the problem was the “line breaks”, they couldn’t have been translated at all ?

    Are you referring to the saved state of the PO file? This is not the issue.

    I’m referring to your plugin looking up these translations from their source code at run time. Any PHP files looking up multi-line translations using a key that contains a DOS line break (CRLF) will not match the required string in the translation file because its keys will contain Unix line breaks (LF) as this is standard for PO/MO files.

    The translations undone are on the front-end. How can I show/tell you wich ones ?

    You can tell me an example source string if you like, but I think the issue is explained now.

    I’d like also help the community by sharing my .mo file “french translation” but I don’t know how to do ?

    Contact the WordPress community translation project.
    https://translate.wordpress.org/locale/fr/default/wp-plugins/directorist/

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.