From dec5344b1f5181818a78af0c9adc2c726fcc037c Mon Sep 17 00:00:00 2001 From: WhoIsJohannes <126110113+WhoIsJohannes@users.noreply.github.com> Date: Sun, 19 Mar 2023 16:19:31 +0100 Subject: [PATCH] Add city size (population) to TradeOffer.kt (#8956) * Add city size (population) to TradeOffer.kt * Add .tr() to city name * Improve i18n * Deprove i18n --- core/src/com/unciv/logic/trade/TradeOffer.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/trade/TradeOffer.kt b/core/src/com/unciv/logic/trade/TradeOffer.kt index fac1ea2f81..c1287bbb6b 100644 --- a/core/src/com/unciv/logic/trade/TradeOffer.kt +++ b/core/src/com/unciv/logic/trade/TradeOffer.kt @@ -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()