• Resolved Roger

    (@erpol53)


    Hi,

    Since one of the recent updates, in some page title strings such as for the month view: “Events for February 2017”, the “for ” is not translated, while the respective string ‘%1$s for %2$s’ is correctly translated in the .po file. The “Events” and month name are correctly translated.

    I tracked the string to src/functions/template-tags/loop.php, and if I manually replace the “for” in the file it does indeed work.

    Any ideas on what’s causing this ?

    Thanks,

    RP

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

    (@oliwood11)

    Hi,

    Not sure if i understood the whole thing, cause i’m new to WP.
    But I think the translation files (the *.po) are not correctly formatted.

    In the fr_FR version I found :
    #: src/functions/template-tags/loop.php:162
    #: src/functions/template-tags/loop.php:171
    msgid “%1$s for %2$s”
    msgstr “%1$s pour %2$s”

    But the php code on the targeted lines mentions the function esc_html_x which relies on a translation context. However, this context does not figure in the .po file. So that the esc_html_x function cannot retrieve the correct translation.

    I replaced esc_html_x with esc_html__ in my version of The Events Calendar plugin, and it worked. So, I see 2 solutions :
    – the contextual esc_html function should not be used (implying less information for the translators),
    – the whole translation files (*.po) have to be merged with the .pot file…

    Hope it helps.
    Olivier

    Thread Starter Roger

    (@erpol53)

    Hi Olivier,

    Thanks, your solution is cleaner than mine (you made the code work instead of just hard-coding the text), but the result will be the same: both will be lost at the next upgrade of The events calendar.

    It’s really the development team’s job to fix the bug in a forthcoming release…

    Best
    RP

    Barry

    (@barryhughes-1)

    Hi!

    We recently added context to those strings (to enable better translations in languages where the context matters).

    Unfortunately, as with any change to our translatable text, that means we’ll need to wait on community translations being provided for those new contextual strings. For some languages they’ve probably already been translated – and you can manually download the most up-to-date translations in such a case.

    So, it’s really not a bug as such: rather it’s an enhancement that will allow for better translations – it’s simply unfortunate that there can be some lag between changes like this and translations becoming available (and we apologize for that, however there isn’t too much we can do on that front).

    Thread Starter Roger

    (@erpol53)

    Hi Barry,

    Sorry for the late response, I had moved on.

    I think you are misunderstanding the issue here: We’re not questioning the fact that the plugin must evolve, and therefore new strings will make their appearance, and need updated translations.

    What we are both saying is that the new ORIGINAl english language strings, were NOT present in the .po file (or the pot file) when the plugin was updated, hence making any translation impossible and necessitating hard coding of the string or additional code to make it work.

    I hope this is clearer, and that the issue has been fixed since…

    RP

    Any update on this issue? I’ve come across a similar problem where the translation for the “%s for” string isn’t working for the Month view calendar’s title. It worked prior to updating the plugin.

    I can’t seem to find a way to translate the “Events for” portion of the title, “Events for June 2017” by updating the .po file.

    Thanks,
    Victor

    Update: I translated the %1$s for %2$s [month view] string in the .po file and that worked.

    Plugin v.4.5.6

    Cheers,
    Victor

    • This reply was modified 7 years, 9 months ago by victorcchan.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Strings not translated in latest version’ is closed to new replies.