Non English Localization using translated message id

Hi there,

We are having the precise same issue as mentioned here:

Where when we edit the English translations in .po files it generates blank entries in other culture .po files, using the modified English translation as the msgid.

However, it was never answered…

Some further detail is that we’ve noticed the localization script must be run twice before the issue appears.

i.e.

  1. Modify english .po
  2. Run localization script → No duplicates created
  3. Run localization script again → Duplicates added to non-english .po files

There is at least one place in code where this directly appears to be happening, in GenerateGatherArchiveCommandlet.cpp starting on line 304.

Specifically on line 324 the translation of the native culture is used as the source for the new entry and the translated text is cleared. I’m not clear on why this code is present because the result is very undesirable.

However, when commenting out the code, no duplicates are created, but when running the game, any text for which a duplicate would have been created (because the english text was edited), will not show it’s translation and will instead default to the source text.

Doing a git blame on the file shows this information for that block of code:

commit 9c5018462aca1592bb38afbc1cc6e45a8eb4f66f
Author:	Saul Abreu <sabreu@phosphorgames.com>  Thu Jun 25 19:32:27 2015
Committer:	sabreu@phosphorgames.com <sabreu@phosphorgames.com>  Thu Jun 25 19:32:27 2015

Foreign archives now generate entries for the native translation of the native source as though it were the native source - the result is that the native translation will also be translated in the foreign culture. Localization resources now use the native translation of the native source as though it were the native source, specifically when looking up the foreign translation to use from archives - the result is that the native source will use the foreign translation of its native translation.

Given "Foo" as the native source and "Bar" as the native translation, the foreign archive will contain translations for "Foo" and for "Bar". The foreign localization resource will specify the foreign translation for "Bar" from the archive  as the translation for "Foo". In effect, foreign translations are now based on native translations rather than the actual native source text.

[CL 2601613 by Saul Abreu in Main branch]

Which is this commit:

https://github.com/EpicGames/UnrealEngine/commit/9c5018462aca1592bb38afbc1cc6e45a8eb4f66f

This is as far as our investigation has gone currently. If anyone has any insight on the problem that would really help us.

Translations for the native culture become the source text for your foreign cultures; this is expected behaviour.

They did however used to export both the source and native entries to the PO files. This often lead to confusion about which one should be translated, so for 4.13 this has been changed to only export the one you actually need to translate.