More translation stuff

When will the madness end?
This commit is contained in:
Yair Morgenstern 2018-07-01 17:27:52 +03:00
parent f08261edaf
commit 62246ff1c9
4 changed files with 8 additions and 5 deletions

View File

@ -134,6 +134,8 @@
Dutch:"Opstellen"
}
"Upgrade to [unitType] ([goldCost] gold)":{} // EG Upgrade to Cannon (140 gold)
"Found city":{
Italian:"Crea città"
Russian:"Создать город"

View File

@ -30,8 +30,8 @@ class YesNoPopupTable(question:String, action:()->Unit,
val skin = CameraStageBaseScreen.skin
add(Label(question,skin)).colspan(2).row()
add(TextButton("No",skin).apply { addClickListener { this@YesNoPopupTable.remove() } })
add(TextButton("Yes",skin).apply { addClickListener { this@YesNoPopupTable.remove(); action() } })
add(TextButton("No".tr(),skin).apply { addClickListener { this@YesNoPopupTable.remove() } })
add(TextButton("Yes".tr(),skin).apply { addClickListener { this@YesNoPopupTable.remove(); action() } })
pack()
center(screen.stage)
screen.stage.addActor(this)

View File

@ -9,6 +9,7 @@ import com.unciv.models.gamebasics.unit.UnitType
import com.unciv.ui.pickerscreens.ImprovementPickerScreen
import com.unciv.ui.pickerscreens.PromotionPickerScreen
import com.unciv.ui.pickerscreens.TechPickerScreen
import com.unciv.ui.utils.tr
import com.unciv.ui.worldscreen.WorldScreen
import com.unciv.ui.worldscreen.optionstable.YesNoPopupTable
import java.util.*
@ -61,7 +62,7 @@ class UnitActions {
val upgradedUnit = GameBasics.Units[unit.getBaseUnit().upgradesTo!!]!!
if (upgradedUnit.isBuildable(unit.civInfo)) {
val goldCostOfUpgrade = (upgradedUnit.cost - unit.getBaseUnit().cost) * 2 + 10
actionList += UnitAction("Upgrade to ${upgradedUnit.name} ($goldCostOfUpgrade gold)",
actionList += UnitAction("Upgrade to [${upgradedUnit.name}] ([$goldCostOfUpgrade] gold)",
{
unit.civInfo.gold -= goldCostOfUpgrade
val unitTile = unit.getTile()
@ -166,7 +167,7 @@ class UnitActions {
actionList += UnitAction("Disband unit",
{
YesNoPopupTable("Do you really want to disband this unit?",
YesNoPopupTable("Do you really want to disband this unit?".tr(),
{unit.removeFromTile(); worldScreen.update()} )
},unit.currentMovement != 0f)

View File

@ -14,7 +14,7 @@ class UnitActionsTable(val worldScreen: WorldScreen) : Table(){
fun getIconForUnitAction(unitAction:String): Image {
if(unitAction.startsWith("Upgrade to")){
val unitToUpgradeTo = Regex("""Upgrade to (\S*)""").find(unitAction)!!.groups[1]!!.value
val unitToUpgradeTo = Regex("""Upgrade to \[(\S*)\]""").find(unitAction)!!.groups[1]!!.value
return ImageGetter.getUnitIcon(unitToUpgradeTo)
}
when(unitAction){