• Resolved slramela

    (@slramela)


    For some reason the plugin is not translated to Finnish despite being installed on a WordPress site with Finnish as the active language.

Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter slramela

    (@slramela)

    @123host I will make that change. However there are problems with the translation, for some reason. This code does not produce a translation :

    _n( 'signature', 'signatures', $petition->signatures, 'speakout' )

    It just prints ‘signatures’, even though the translation is present in the .po file. I even recompiled the .mo file form the .po file and that did not help.

    The translation is on lines 295-296 of the .po file.

    Plugin Author 123host

    (@123host)

    THanks for that.

    This is on the bottom of the petition, right? Someone else mentioned this in a different translation but I couldn’t find any problem.

    I might completely re-write that line and see if it helps. It is hard for me to tell because I work in English.

    Thread Starter slramela

    (@slramela)

    Yea, it is weird. It is like the ´_n()´ function just refuses to load the string.

    Hopefully I or my client won’t bumb into too many of those…

    I overcame this with the ´do_shortcode_tag´ filter and ´str_replace´ but it is such a hack.

    By the way, for that specific spot in the emailpetition.php, the best Finnish translation for ‘signatures’ is ‘allekirjoitusta’. Problematically in other contexts the word ‘allekirjoitus’ will have a different modifier applied to it and that one won’t apply.

    I don’t know what you can do about that, though. Finnish is a pain in the ass to translate into.

    • This reply was modified 4 years, 9 months ago by slramela.

    @123host

    _n( 'signature', 'signatures', $petition->signatures, 'speakout' )

    It just prints ‘signatures’, even though the translation is present in the .po file. I even recompiled the .mo file form the .po file and that did not help.

    _n() should not be used in that way. I believe that you’re trying to glue together several substrings to a full sentence. But word order is different in other languages. If possible, for instance, German wants the verb to be at the end of the sentence.

    So, much better to give the translators something like:

    Currently %d petition has been signed/Currently %d petitions have been signed

    … you can look for inspiration here:
    https://themes.trac.wordpress.org/browser/twentynineteen/1.4/comments.php?marks=42-52#L42

    EditAdd: Just to confuse you even more, they’re using the _n() function with context flag, i.e. _nx()

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘Localisation not working’ is closed to new replies.