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.
Details
- 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
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/
- 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. |
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.
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. |
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. |