diff --git a/android/assets/jsons/Translations.json b/android/assets/jsons/Translations.json index 9a41cff6..94a79186 100644 --- a/android/assets/jsons/Translations.json +++ b/android/assets/jsons/Translations.json @@ -81,6 +81,9 @@ Romanian:"Fortifica" } + "Set up":{ // For siege units + } + "Health":{ Italian:"Salute" Russian:"Здоровье" @@ -203,28 +206,73 @@ "Maintainance cost":{ } + + + "Pick construction":{ // eg Build Granary + } + + "Build":{ // eg Build Granary + } + + "Train":{ // eg Train Scout + } // Notifications - " has grown":{ // eg Alexandria has grown + // Some notifications have an exclamation mark after them - is the exclamation mark different in other languages? + // If so then we need to deal with that as well + // I remember that some languages have upside-down question marks before to mark a question + + " has grown":{ + } + + " has been founded!":{ + } + + " has been razed to the ground!":{ + } + + "We have conquered the city of ":{ + } + + "Research of ":{ // For technology notifications EG Research of Writing has completed + } + + " has completed":{ } - " is starving":{ + " is starving!":{ + } + + "has been built in":{ + } + + "Work has started on":{ + } + + "Cannot continue work on":{ } - " has expanded its borders":{ // eg Alexandria has grown + " has expanded its borders":{ } "An enemy ":{ } - " has attacked our ":{ // eg Alexandria has grown + " has attacked ":{ } - " has destroyed our ":{ // eg Alexandria has grown + " has destroyed ":{ + } + + " has captured ":{ + } + + " revealed near ":{ // As in "Coal revealed near London" + } + + "The civilization of":{ + } + "has been destroyed!":{ } - - - - } diff --git a/core/src/com/unciv/logic/battle/Battle.kt b/core/src/com/unciv/logic/battle/Battle.kt index f2e8615e..8b025f18 100644 --- a/core/src/com/unciv/logic/battle/Battle.kt +++ b/core/src/com/unciv/logic/battle/Battle.kt @@ -6,6 +6,7 @@ import com.unciv.logic.GameInfo import com.unciv.logic.city.CityInfo import com.unciv.logic.map.TileInfo import com.unciv.models.gamebasics.unit.UnitType +import com.unciv.ui.utils.tr import java.util.* import kotlin.collections.HashMap import kotlin.math.max @@ -229,7 +230,7 @@ class Battle(val gameInfo:GameInfo=UnCivGame.Current.gameInfo) { return } // barbarians don't capture civilians! val capturedUnit = (defender as MapUnitCombatant).unit - capturedUnit.civInfo.addNotification("Our "+defender.getName()+" was captured by an enemy "+attacker.getName(), + capturedUnit.civInfo.addNotification("An enemy ".tr()+attacker.getName()+" has captured our "+defender.getName()+"!", defender.getTile().position, Color.RED) capturedUnit.civInfo = attacker.getCivilization() capturedUnit.owner = capturedUnit.civInfo.civName diff --git a/core/src/com/unciv/models/gamebasics/Building.kt b/core/src/com/unciv/models/gamebasics/Building.kt index 09d9a32b..1e87a020 100644 --- a/core/src/com/unciv/models/gamebasics/Building.kt +++ b/core/src/com/unciv/models/gamebasics/Building.kt @@ -4,6 +4,7 @@ import com.unciv.logic.city.CityConstructions import com.unciv.logic.city.IConstruction import com.unciv.models.stats.NamedStats import com.unciv.models.stats.Stats +import com.unciv.ui.utils.tr class Building : NamedStats(), IConstruction{ private var baseDescription: String? = null @@ -105,11 +106,11 @@ class Building : NamedStats(), IConstruction{ if (stats.toString() != "") stringBuilder.appendln(stats) if (this.percentStatBonus != null) { - if (this.percentStatBonus!!.production != 0f) stringBuilder.append("+" + this.percentStatBonus!!.production.toInt() + "% production\r\n") - if (this.percentStatBonus!!.gold != 0f) stringBuilder.append("+" + this.percentStatBonus!!.gold.toInt() + "% gold\r\n") - if (this.percentStatBonus!!.science != 0f) stringBuilder.append("+" + this.percentStatBonus!!.science.toInt() + "% science\r\n") - if (this.percentStatBonus!!.food != 0f) stringBuilder.append("+" + this.percentStatBonus!!.food.toInt() + "% food\r\n") - if (this.percentStatBonus!!.culture != 0f) stringBuilder.append("+" + this.percentStatBonus!!.culture.toInt() + "% culture\r\n") + if (this.percentStatBonus!!.production != 0f) stringBuilder.append("+" + this.percentStatBonus!!.production.toInt() + "% "+"Production".tr()+"\r\n") + if (this.percentStatBonus!!.gold != 0f) stringBuilder.append("+" + this.percentStatBonus!!.gold.toInt() + "% "+"Gold".tr()+"\r\n") + if (this.percentStatBonus!!.science != 0f) stringBuilder.append("+" + this.percentStatBonus!!.science.toInt() + "% "+"Science".tr()+"\r\n") + if (this.percentStatBonus!!.food != 0f) stringBuilder.append("+" + this.percentStatBonus!!.food.toInt() + "% "+"Food".tr()+"\r\n") + if (this.percentStatBonus!!.culture != 0f) stringBuilder.append("+" + this.percentStatBonus!!.culture.toInt() + "% "+"Culture".tr()+"\r\n") } if (this.greatPersonPoints != null) { val gpp = this.greatPersonPoints!! diff --git a/core/src/com/unciv/models/stats/Stats.kt b/core/src/com/unciv/models/stats/Stats.kt index efcef03e..357e70d6 100644 --- a/core/src/com/unciv/models/stats/Stats.kt +++ b/core/src/com/unciv/models/stats/Stats.kt @@ -1,5 +1,7 @@ package com.unciv.models.stats +import com.unciv.ui.utils.tr + open class Stats() { var production: Float=0f @@ -47,7 +49,7 @@ open class Stats() { override fun toString(): String { return toHashMap().filter { it.value != 0f } - .map { (if(it.value>0)"+" else "") + it.value.toInt()+" "+it.key.toString() }.joinToString() + .map { (if(it.value>0)"+" else "") + it.value.toInt()+" "+it.key.toString().tr() }.joinToString() } fun toHashMap(): HashMap { diff --git a/core/src/com/unciv/ui/pickerscreens/ConstructionPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/ConstructionPickerScreen.kt index 54404ad0..ecf03c2c 100644 --- a/core/src/com/unciv/ui/pickerscreens/ConstructionPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/ConstructionPickerScreen.kt @@ -33,7 +33,7 @@ class ConstructionPickerScreen(val city: CityInfo) : PickerScreen() { dispose() } - rightSideButton.setText("Pick building") + rightSideButton.setText("Pick construction".tr()) rightSideButton.addClickListener { city.cityConstructions.currentConstruction = selectedProduction!! city.cityStats.update() // Because maybe we set/removed the science or gold production options. diff --git a/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt b/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt index 0ae9a429..508f9913 100644 --- a/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt +++ b/core/src/com/unciv/ui/worldscreen/unit/UnitActionsTable.kt @@ -51,10 +51,10 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table(){ private fun getUnitActionButton(unitAction: UnitAction): Button { val actionButton = Button(CameraStageBaseScreen.skin) actionButton.add(getIconForUnitAction(unitAction.name)).size(20f).pad(5f) - actionButton.add(Label(unitAction.name,CameraStageBaseScreen.skin) + actionButton.add(Label(unitAction.name.tr(),CameraStageBaseScreen.skin) .setFontColor(Color.WHITE)).pad(5f) actionButton.pack() - actionButton.addClickListener({ unitAction.action(); UnCivGame.Current.worldScreen!!.update() }) + actionButton.addClickListener({ unitAction.action(); UnCivGame.Current.worldScreen.update() }) if (!unitAction.canAct) actionButton.disable() return actionButton }