From 84007533fc7e68a6e26d28274817f62c324ed13d Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 6 Jan 2019 22:48:24 +0200 Subject: [PATCH] Resolved #311 - translate victory screen --- android/assets/jsons/Translations.json | 15 ++++++++++++++ core/src/com/unciv/ui/VictoryScreen.kt | 28 ++++++++++++-------------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/android/assets/jsons/Translations.json b/android/assets/jsons/Translations.json index 27b3c6a63b..421ab26fa5 100644 --- a/android/assets/jsons/Translations.json +++ b/android/assets/jsons/Translations.json @@ -6444,4 +6444,19 @@ Russian:"+15% К производству военных юнитов, Военные юниты начинают с 15 опыта" } + // Victory Screen + "Science victory":{} + "Cultural victory":{} + "Conquest victory":{} + "Complete all the spaceship parts\n to win!":{} + "Complete 4 policy branches\n to win!":{} + "Destroy all enemies\n to win!":{} + "You have won a scientific victory!":{} + "You have won a cultural victory!":{} + "You have won a conquest victory!":{} + "One more turn...!":{} + "Built Apollo Program":{} + "Destroy [civName]":{} + + } diff --git a/core/src/com/unciv/ui/VictoryScreen.kt b/core/src/com/unciv/ui/VictoryScreen.kt index 89ebd1455c..7f340441c6 100644 --- a/core/src/com/unciv/ui/VictoryScreen.kt +++ b/core/src/com/unciv/ui/VictoryScreen.kt @@ -12,24 +12,22 @@ import com.unciv.ui.utils.onClick class VictoryScreen : PickerScreen() { - // todo translate this screen - val playerCivInfo = UnCivGame.Current.gameInfo.getPlayerCivilization() init { topTable.skin=skin topTable.defaults().pad(10f) - topTable.add("Science victory") - topTable.add("Cultural victory") - topTable.add("Conquest victory") + topTable.add("Science victory".tr()) + topTable.add("Cultural victory".tr()) + topTable.add("Conquest victory".tr()) topTable.row() topTable.add(scienceVictoryColumn()) topTable.add(culturalVictoryColumn()) topTable.add(conquestVictoryColumn()) topTable.row() - topTable.add("Complete all the spaceship parts\n to win!") - topTable.add("Complete 4 policy branches\n to win!") - topTable.add("Destroy all enemies\n to win!") + topTable.add("Complete all the spaceship parts\n to win!".tr()) + topTable.add("Complete 4 policy branches\n to win!".tr()) + topTable.add("Destroy all enemies\n to win!".tr()) rightSideButton.isVisible=false @@ -47,14 +45,14 @@ class VictoryScreen : PickerScreen() { } fun won(description: String) { - descriptionLabel.setText(description) + descriptionLabel.setText(description.tr()) rightSideButton.setText("Start new game".tr()) rightSideButton.isVisible = true rightSideButton.enable() rightSideButton.onClick { UnCivGame.Current.startNewGame() } - closeButton.setText("One more turn...!") + closeButton.setText("One more turn...!".tr()) closeButton.onClick { playerCivInfo.gameInfo.oneMoreTurnMode = true UnCivGame.Current.setWorldScreen() @@ -64,7 +62,7 @@ class VictoryScreen : PickerScreen() { fun scienceVictoryColumn():Table{ val t = Table() t.defaults().pad(5f) - t.add(getMilestone("Built Apollo Program",playerCivInfo.getBuildingUniques().contains("Enables construction of Spaceship parts"))).row() + t.add(getMilestone("Built Apollo Program".tr(),playerCivInfo.getBuildingUniques().contains("Enables construction of Spaceship parts"))).row() val victoryManager= playerCivInfo.victoryManager @@ -86,16 +84,16 @@ class VictoryScreen : PickerScreen() { } fun conquestVictoryColumn():Table{ - val t=Table() - t.defaults().pad(5f) + val table=Table() + table.defaults().pad(5f) for (civ in playerCivInfo.gameInfo.civilizations) { if (civ.isPlayerCivilization() || civ.isBarbarianCivilization()) continue val civName = if (playerCivInfo.diplomacy.containsKey(civ.civName)) civ.civName else "???" - t.add(getMilestone("Destroy $civName", civ.isDefeated())).row() + table.add(getMilestone("Destroy [$civName]".tr(), civ.isDefeated())).row() } - return t + return table } fun getMilestone(text:String, achieved:Boolean): TextButton {