Page MenuHomeWildfire Games

Show translations of the labels of the tab-buttons in the credits gui page.
ClosedPublic

Authored by s0600204 on Dec 16 2018, 10:10 PM.

Details

Summary

As reported by thekolian1996 on the forums, the labels of the buttons of the Credits page are not using/displaying their translated texts when viewed with a non-English language.

Test Plan
  • View credits page under a non-English language to confirm non-translation of button text.
  • Apply patch.
  • Reload 0 A.D., and confirm translations now being displayed.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

s0600204 created this revision.Dec 16 2018, 10:10 PM
Vulcan added a subscriber: Vulcan.Dec 16 2018, 10:11 PM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/credits/credits.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/credits/credits.js
|  65|  65| 		if (object.List)
|  66|  66| 		{
|  67|  67| 			for (let element of object.List)
|  68|    |-			{
|    |  68|+			
|  69|  69| 				if (element.nick && element.name)
|  70|  70| 					result += "[font=\"sans-14\"]" + sprintf(translate("%(nick)s - %(name)s"), { "nick": element.nick, "name": element.name }) + "\n";
|  71|  71| 				else if (element.nick)
|  72|  72| 					result += "[font=\"sans-14\"]" + element.nick + "\n";
|  73|  73| 				else if (element.name)
|  74|  74| 					result += "[font=\"sans-14\"]" + element.name + "\n";
|  75|    |-			}
|    |  75|+			
|  76|  76| 
|  77|  77| 			result += "\n";
|  78|  78| 		}

Link to build: https://jenkins.wildfiregames.com/job/differential/824/

elexis accepted this revision.Dec 17 2018, 12:31 AM
elexis added a subscriber: elexis.
  • blame which revision broke it, it's rP20684
  • One could check for the same error in other pages of that commit
  • (It wasn't obvious what was missing)
  • (Guess unrelated, but: the language names aren't translated into the selected language but into the language of that string, i.e. it should show "German", not "Deutsch" if the currently selected language is english.)
  • (The "font=" strings are superseded by setStringTags(), but that's a different construction site)
  • (Was wondering whether adding one more translate call was preferable over adding the translateObjectKeys, but that didn't manifest)

(With the re-release so near, I wasn't sure if a direct commit straight to the repo was ok.)

(Could only be committed prior to the re-release if we know that the release candidates have to be redone, but currently they look okay.)

binaries/data/mods/public/gui/credits/credits.js
31 ↗(On Diff #7046)

(perhaps a throw is nicer)

34 ↗(On Diff #7046)

here the translate was missing.
(Why is the "|| category" here? Prior to said commit it tried to translate that filename)

This revision is now accepted and ready to land.Dec 17 2018, 12:31 AM
Itms awarded a token.Dec 17 2018, 8:16 PM
Itms added a subscriber: Itms.Dec 17 2018, 8:19 PM

Thanks for tracking this one down ?

I am also in favor of keeping it for A24. If you want to include it, you can, after all it's pretty safe to include, but I (and Stan, I guess) would much prefer not re-running the bundle scripts.

lyv added a subscriber: lyv.Dec 18 2018, 1:36 PM
lyv added inline comments.
binaries/data/mods/public/gui/credits/credits.js
69 ↗(On Diff #7046)

Why should this be translated?

grep -rC1 "msgid \"%(nick)s - %(name)s\"" | grep "msgstr" says the only effect this would probably have is a mistranslation breaking the sprintf.

elexis added inline comments.Dec 18 2018, 1:39 PM
binaries/data/mods/public/gui/credits/credits.js
69 ↗(On Diff #7046)

A translation may want to use different symbol for the dash, may want to add quotes, reverse the order or such.
The rule is simple: If it's a displayed string, it should be translated, because everything that makes sense in english may differ in a different language.

This revision was automatically updated to reflect the committed changes.