Page MenuHomeWildfire Games

Improve the plural translation of the "<players> have won" string
Needs RevisionPublic

Authored by Gallaecio on Aug 18 2018, 7:55 PM.



Reported by GunChleoc on Transifex.

Test Plan

I’ve not actually tested this change, and although it looks fine my eyes are not a JavaScript interpreter, so before merging this change I should perform some testing, e.g. getting both messages to appear as expected.

Diff Detail

rP 0 A.D. Public Repository
Lint Skipped
Unit Tests Skipped
Build Status
Buildable 6337
Build 10512: Vulcan BuildJenkins

Unit TestsFailed

0 msJenkins > cxxtest_debug.xml::[failed-to-read]
Failed to read test report file /mnt/data/jenkins-phabricator/workspace/differential/cxxtest_debug.xml org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog. at
0 msJenkins > TestAllocators::test_da
0 msJenkins > TestAtlasObjectXML::test_parse_attributes1
0 msJenkins > TestAtlasObjectXML::test_parse_attributes2
0 msJenkins > TestAtlasObjectXML::test_parse_basic
View Full Test Results (1 Failed · 312 Passed)

Event Timeline

Gallaecio created this revision.Aug 18 2018, 7:55 PM
Vulcan added a subscriber: Vulcan.Aug 18 2018, 7:58 PM

Build failure - The Moirai have given mortals hearts that can endure.

Linter detected issues:
Executing section Default...
Executing section Source...
Executing section JS...

| 174| »   »   »   let·message·=·markForTranslation(
|    | [MAJOR] ESLintBear:
|    | Parsing error: Unexpected token let

| 174| »   »   »   let·message·=·markForTranslation(
|    | [MAJOR] JSHintBear:
|    | Let declaration not directly within block.

| 177| »   »   »   let·message·=·markForPluralTranslation(
|    | [MAJOR] JSHintBear:
|    | Let declaration not directly within block.

Link to build:

elexis requested changes to this revision.Aug 26 2018, 1:19 PM
elexis added a subscriber: elexis.

That what the bot says: let limits the scope of the variable to the scope of the statement it's defined in.

(Marking as red so people know that it wasn't a jenkins malfunction.)

You can use

         allies.length == 1 ?
             markForTranslation("%(lastPlayer)s has won (last player alive).") : 
              markForPluralTranslation(%(players)s and %(lastPlayer)s have won (last players alive).", allies.length),

or something like that.

(Also note that the NOTE: note is redundant with the fact that this is a code comment, which always represents a note)

This revision now requires changes to proceed.Aug 26 2018, 1:19 PM