From 4d285e972d9d6f64002816e5d698351b77578130 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sat, 26 Oct 2019 20:27:01 +0300 Subject: [PATCH] Can now translate [year] BC / [year] AD (#1240) --- android/assets/jsons/Translations/Other.json | 11 ++++++----- .../src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt | 10 ++++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/android/assets/jsons/Translations/Other.json b/android/assets/jsons/Translations/Other.json index b7988857d5..4823999a9b 100644 --- a/android/assets/jsons/Translations/Other.json +++ b/android/assets/jsons/Translations/Other.json @@ -617,14 +617,15 @@ Portuguese:"IDADE DOURADA" Japanese:"黄金時代" Czech:"ZLATÝ VĚK" -} +}, - " BC":{ // Before Christus - Czech:" př. n. l." + // You don't have to translate this is it's good for your language, but some languages have their own display + "[year] BC":{ // Before Christus + Czech:"[year] př. n. l." }, - " AC":{ // Anno Domini - Czech:" n. l." + "[year] AD":{ // Anno Domini + Czech:"[year] n. l." }, /////// Menu table diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt index debe032259..ac403396d7 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt @@ -18,6 +18,7 @@ import com.unciv.ui.utils.* import com.unciv.ui.worldscreen.optionstable.WorldScreenMenuTable import kotlin.math.abs import kotlin.math.ceil +import kotlin.math.roundToInt class WorldScreenTopBar(val screen: WorldScreen) : Table() { @@ -128,13 +129,14 @@ class WorldScreenTopBar(val screen: WorldScreen) : Table() { else -> 2020+(turns-440)/2 } - turnsLabel.setText("Turn".tr()+" " + civInfo.gameInfo.turns + " | "+ abs(year)+(if (year<0) " BC.tr()" else " AD.tr()")) + val yearText = "["+ abs(year)+"] "+ if (year<0) "BC" else "AD" + turnsLabel.setText("Turn".tr()+" " + civInfo.gameInfo.turns + " | "+ yearText.tr()) val nextTurnStats = civInfo.statsForNextTurn - val goldPerTurn = "(" + (if (nextTurnStats.gold > 0) "+" else "") + Math.round(nextTurnStats.gold) + ")" - goldLabel.setText(Math.round(civInfo.gold.toFloat()).toString() + goldPerTurn) + val goldPerTurn = "(" + (if (nextTurnStats.gold > 0) "+" else "") + nextTurnStats.gold.roundToInt() + ")" + goldLabel.setText(civInfo.gold.toFloat().roundToInt().toString() + goldPerTurn) - scienceLabel.setText("+" + Math.round(nextTurnStats.science)) + scienceLabel.setText("+" + nextTurnStats.science.roundToInt()) happinessLabel.setText(getHappinessText(civInfo))