From 4b2bde03650d4816c9f0565aae6bb087893597fd Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 13 Feb 2022 10:58:47 +0200 Subject: [PATCH] Resolved untranslated texts as per #6131 - "Resources" in city-state diplomacy screen - "When Friends"/"When Allies" in same - "Enhance religion" - "Choose a Religion" in religion screen - Religion name in religion screen - Translated drilldown items in city screen - "null for wheat" in improvement Civilopedia entry - "Type" and others in city-state civilopedia entry --- android/assets/jsons/translations/template.properties | 1 + core/src/com/unciv/models/ruleset/Nation.kt | 6 +++--- core/src/com/unciv/models/ruleset/tile/TileImprovement.kt | 1 + core/src/com/unciv/ui/cityscreen/CityInfoTable.kt | 2 +- .../unciv/ui/pickerscreens/ReligiousBeliefsPickerScreen.kt | 4 ++-- core/src/com/unciv/ui/trade/DiplomacyScreen.kt | 6 +++--- core/src/com/unciv/ui/worldscreen/WorldScreen.kt | 2 +- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index fd198b7acd..3729865ade 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -1177,6 +1177,7 @@ Choose any belief! = Found [religionName] = Enhance [religionName] = Choose a pantheon = +Choose a Religion = Found Religion = Found Pantheon = Follow [belief] = diff --git a/core/src/com/unciv/models/ruleset/Nation.kt b/core/src/com/unciv/models/ruleset/Nation.kt index bf275e0e1c..0ae7a209a3 100644 --- a/core/src/com/unciv/models/ruleset/Nation.kt +++ b/core/src/com/unciv/models/ruleset/Nation.kt @@ -148,7 +148,7 @@ class Nation : RulesetObject() { private fun getCityStateInfo(ruleset: Ruleset): List { val textList = ArrayList() - textList += FormattedLine("Type: [$cityStateType]", header = 4, color = cityStateType!!.color) + textList += FormattedLine("{Type}: [$cityStateType]", header = 4, color = cityStateType!!.color) val era = if (UncivGame.isCurrentInitialized() && UncivGame.Current.isGameInfoInitialized()) UncivGame.Current.gameInfo.currentPlayerCiv.getEra() @@ -159,7 +159,7 @@ class Nation : RulesetObject() { val friendBonus = era.friendBonus[cityStateType!!.name] if (friendBonus != null && friendBonus.isNotEmpty()) { textList += FormattedLine() - textList += FormattedLine("When Friends: ") + textList += FormattedLine("{When Friends}: ") friendBonus.forEach { textList += FormattedLine(Unique(it), indent = 1) if (it == "Provides a unique luxury") showResources = true @@ -169,7 +169,7 @@ class Nation : RulesetObject() { val allyBonus = era.allyBonus[cityStateType!!.name] if (allyBonus != null && allyBonus.isNotEmpty()) { textList += FormattedLine() - textList += FormattedLine("When Allies: ") + textList += FormattedLine("{When Allies}: ") allyBonus.forEach { textList += FormattedLine(Unique(it), indent = 1) if (it == "Provides a unique luxury") showResources = true diff --git a/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt b/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt index ae5a7518ef..6a54ce9158 100644 --- a/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt +++ b/core/src/com/unciv/models/ruleset/tile/TileImprovement.kt @@ -120,6 +120,7 @@ class TileImprovement : RulesetStatsObject() { var addedLineBeforeResourceBonus = false for (resource in ruleset.tileResources.values.filter { it.improvement == name }) { + if (resource.improvementStats == null) continue if (!addedLineBeforeResourceBonus) { addedLineBeforeResourceBonus = true textList += FormattedLine() diff --git a/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt b/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt index fc074290e6..db38088037 100644 --- a/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt +++ b/core/src/com/unciv/ui/cityscreen/CityInfoTable.kt @@ -151,7 +151,7 @@ class CityInfoTable(private val cityScreen: CityScreen) : Table(BaseScreen.skin) for ((name, child) in statTreeNode.children) { val statAmount = child.totalStats[stat] if (statAmount == 0f) continue - hashMap["- ".repeat(indentation) + name] = statAmount + hashMap["- ".repeat(indentation) + name.tr()] = statAmount if (showDetails) addStatsToHashmap(child, hashMap, stat, showDetails, indentation + 1) } } diff --git a/core/src/com/unciv/ui/pickerscreens/ReligiousBeliefsPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/ReligiousBeliefsPickerScreen.kt index f0cf9395c2..cfeb037457 100644 --- a/core/src/com/unciv/ui/pickerscreens/ReligiousBeliefsPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/ReligiousBeliefsPickerScreen.kt @@ -52,7 +52,7 @@ class ReligiousBeliefsPickerScreen ( topTable.addSeparator() topTable.add(middlePanes) - if (pickIconAndName) rightSideButton.label = "Choose a religion".toLabel() + if (pickIconAndName) rightSideButton.label = "Choose a Religion".toLabel() else rightSideButton.label = "Enhance [${choosingCiv.religionManager.religion!!.getReligionDisplayName()}]".toLabel() rightSideButton.onClick(UncivSound.Choir) { choosingCiv.religionManager.chooseBeliefs(displayName, religionName, chosenBeliefs.map { it!! }) @@ -76,7 +76,7 @@ class ReligiousBeliefsPickerScreen ( fun changeDisplayedReligionName(newReligionName: String) { displayName = newReligionName rightSideButton.label = "Found [$newReligionName]".toLabel() - descriptionLabel.setText(newReligionName) + descriptionLabel.setText(newReligionName.tr()) } val changeReligionNameButton = Button( diff --git a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt index 3147ec89a9..cd818b5350 100644 --- a/core/src/com/unciv/ui/trade/DiplomacyScreen.kt +++ b/core/src/com/unciv/ui/trade/DiplomacyScreen.kt @@ -145,7 +145,7 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo): BaseScreen() { if (otherCiv.detailedCivResources.any { it.resource.resourceType != ResourceType.Bonus }) { val resourcesTable = Table() - resourcesTable.add("{Resources:} ".toLabel()).padRight(10f) + resourcesTable.add("{Resources}: ".toLabel()).padRight(10f) for (supplyList in otherCiv.detailedCivResources) { if (supplyList.resource.resourceType == ResourceType.Bonus) continue @@ -196,12 +196,12 @@ class DiplomacyScreen(val viewingCiv:CivilizationInfo): BaseScreen() { val eraInfo = viewingCiv.getEra() - var friendBonusText = "{When Friends:} ".tr() + var friendBonusText = "{When Friends}: ".tr() val friendBonusObjects = eraInfo.getCityStateBonuses(otherCiv.cityStateType, RelationshipLevel.Friend) val friendBonusStrings = getAdjustedBonuses(friendBonusObjects) friendBonusText += friendBonusStrings.joinToString(separator = ", ") { it.tr() } - var allyBonusText = "{When Allies:} ".tr() + var allyBonusText = "{When Allies}: ".tr() val allyBonusObjects = eraInfo.getCityStateBonuses(otherCiv.cityStateType, RelationshipLevel.Ally) val allyBonusStrings = getAdjustedBonuses(allyBonusObjects) allyBonusText += allyBonusStrings.joinToString(separator = ", ") { it.tr() } diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index 88517d7408..cbf7dfaaa1 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -774,7 +774,7 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Bas } viewingCiv.religionManager.religionState == ReligionState.EnhancingReligion -> - NextTurnAction("Enhance Religion", Color.ORANGE) { + NextTurnAction("Enhance a Religion", Color.ORANGE) { game.setScreen( ReligiousBeliefsPickerScreen( viewingCiv,