Add city size (population) to TradeOffer.kt (#8956)

* Add city size (population) to TradeOffer.kt

* Add .tr() to city name

* Improve i18n

* Deprove i18n
This commit is contained in:
WhoIsJohannes
2023-03-19 16:19:31 +01:00
committed by GitHub
parent fccfef8412
commit dec5344b1f

View File

@ -38,7 +38,11 @@ data class TradeOffer(val name: String, val type: TradeType, var amount: Int = 1
var offerText = when(type){
TradeType.WarDeclaration -> "Declare war on [$name]"
TradeType.Introduction -> "Introduction to [$name]"
TradeType.City -> UncivGame.Current.gameInfo!!.getCities().firstOrNull{ it.id == name }?.name ?: "Non-existent city"
TradeType.City -> {
val city =
UncivGame.Current.gameInfo!!.getCities().firstOrNull { it.id == name }
city?.run { "{$name} (${population.population})" } ?: "Non-existent city"
}
else -> name
}.tr()