1
1
forked from 0ad/0ad

Fix invalid translations in the game options.

Comments and fixes by: @bb
Fixes: #6197
Differential Revision: https://code.wildfiregames.com/D4083
This was SVN commit r26531.
This commit is contained in:
Stan 2022-03-03 13:34:15 +00:00
parent fefde41317
commit fa5671438a
2 changed files with 39 additions and 39 deletions

View File

@ -122,7 +122,7 @@ function translatePluralWithContext(context, singularMessage, pluralMessage, num
/**
* The input object should contain either of the following properties:
*
* A message property that contains a message to translate.
* A _string property that contains a message to translate.
*
* A list property that contains a list of messages to translate as a
* comma-separated list of translated.
@ -137,8 +137,8 @@ function translateMessageObject(object)
if (object.context)
trans = msg => translateWithContext(object.context, msg);
if (object.message)
object = trans(object.message);
if (object._string)
object = trans(object._string);
else if (object.list)
object = object.list.map(trans).join(translateWithContext("enumeration", ", "));
@ -152,19 +152,19 @@ function translateMessageObject(object)
* it accepts an object in the form of
*
* {
* translatedString1: "my first message",
* unTranslatedString1: "some English string",
* ignoredObject: {
* translatedString2: "my second message",
* unTranslatedString2: "some English string"
* "translatedString1": "my first message",
* "unTranslatedString1": "some English string",
* "ignoredObject": {
* "translatedString2": "my second message",
* "unTranslatedString2": "some English string"
* },
* translatedObject1: {
* message: "my third singular message",
* context: "message context",
* "translatedObject1": {
* "_string": "my third singular message",
* "context": "message context",
* },
* translatedObject2: {
* list: ["list", "of", "strings"],
* context: "message context",
* "list": ["list", "of", "strings"],
* "context": "message context",
* },
* }
*
@ -174,14 +174,14 @@ function translateMessageObject(object)
*
* The result will be (f.e. in Dutch)
* {
* translatedString1: "mijn eerste bericht",
* unTranslatedString1: "some English string",
* ignoredObject: {
* translatedString2: "mijn tweede bericht",
* unTranslatedString2: "some English string"
* "translatedString1": "mijn eerste bericht",
* "unTranslatedString1": "some English string",
* "ignoredObject": {
* "translatedString2": "mijn tweede bericht",
* "unTranslatedString2": "some English string"
* },
* translatedObject1: "mijn derde bericht",
* translatedObject2: "lijst, van, teksten",
* "translatedObject1": "mijn derde bericht",
* "translatedObject2": "lijst, van, teksten",
* }
*
* So you see that the keys array can also contain lower-level keys,

View File

@ -244,9 +244,9 @@
"tooltip": "Model quality setting.",
"config": "max_actor_quality",
"list": [
{ "value": 100, "label": "Low", "tooltip": "Simpler models for better performance." },
{ "value": 150, "label": "Medium", "tooltip": "Average quality and average performance." },
{ "value": 200, "label": "High", "tooltip": "High quality models." }
{ "value": 100, "label": { "_string": "Low", "context": "Option for the meshes' level of detail." }, "tooltip": "Simpler models for better performance." },
{ "value": 150, "label": { "_string": "Medium", "context": "Option for the meshes' level of detail." }, "tooltip": "Average quality and average performance." },
{ "value": 200, "label": { "_string": "High", "context": "Option for the meshes' level of detail." }, "tooltip": "High quality models." }
]
},
{
@ -255,9 +255,9 @@
"tooltip": "Randomize the appearance of entities. Disabling gives a small performance improvement.",
"config": "variant_diversity",
"list": [
{ "value": "none", "label": "None", "tooltip": "Entities will all look the same." },
{ "value": "limited", "label": "Limited", "tooltip": "Entities will be less diverse." },
{ "value": "full", "label": "Normal", "tooltip": "Entities appearance is randomized normally." }
{ "value": "none", "label": { "_string": "None", "context": "Option for the meshes' amount of variety." }, "tooltip": "Entities will all look the same." },
{ "value": "limited", "label": { "_string": "Limited", "context": "Option for the meshes' amount of variety." }, "tooltip": "Entities will be less diverse." },
{ "value": "full", "label": { "_string": "Normal", "context": "Option for the meshes' amount of variety." }, "tooltip": "Entities appearance is randomized normally." }
]
},
{
@ -281,10 +281,10 @@
"dependencies": ["shadows"],
"config": "shadowquality",
"list": [
{ "value": -1, "label": "Low" },
{ "value": 0, "label": "Medium" },
{ "value": 1, "label": "High" },
{ "value": 2, "label": "Very High" }
{ "value": -1, "label": { "_string": "Low", "context": "Option for the shadow quality." } },
{ "value": 0, "label": { "_string": "Medium", "context": "Option for the shadow quality." } },
{ "value": 1, "label": { "_string": "High", "context": "Option for the shadow quality." } },
{ "value": 2, "label": { "_string": "Very High", "context": "Option for the shadow quality." } }
]
},
{
@ -350,9 +350,9 @@
"tooltip": "Decrease texture quality making them blurrier but increases game performance.",
"config": "textures.quality",
"list": [
{ "value": 0, "label": "Low", "tooltip": "Low" },
{ "value": 1, "label": "Medium", "tooltip": "Medium" },
{ "value": 2, "label": "High", "tooltip": "High" }
{ "value": 0, "label": { "_string": "Low", "context": "Option for the texture quality." }, "tooltip": "Low" },
{ "value": 1, "label": { "_string": "Medium", "context": "Option for the texture quality." }, "tooltip": "Medium" },
{ "value": 2, "label": { "_string": "High", "context": "Option for the texture quality." }, "tooltip": "High" }
]
},
{
@ -461,12 +461,12 @@
"tooltip": "Default difficulty of the AI.",
"config": "gui.gamesetup.aidifficulty",
"list": [
{ "value": 0, "label": "Sandbox" },
{ "value": 1, "label": "Very Easy" },
{ "value": 2, "label": "Easy" },
{ "value": 3, "label": "Medium" },
{ "value": 4, "label": "Hard" },
{ "value": 5, "label": "Very Hard" }
{ "value": 0, "label": { "_string": "Sandbox", "context": "Option for the AI difficulty." }},
{ "value": 1, "label": { "_string": "Very Easy", "context": "Option for the AI difficulty." }},
{ "value": 2, "label": { "_string": "Easy", "context": "Option for the AI difficulty." }},
{ "value": 3, "label": { "_string": "Medium", "context": "Option for the AI difficulty." }},
{ "value": 4, "label": { "_string": "Hard", "context": "Option for the AI difficulty." }},
{ "value": 5, "label": { "_string": "Very Hard", "context": "Option for the AI difficulty." }}
]
},
{