mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 15:29:32 +07:00
Resolved #8968 - stats for notifications string'd without special characters
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
package com.unciv.models.stats
|
||||
|
||||
import com.unciv.Constants
|
||||
import com.unciv.models.translations.tr
|
||||
import kotlin.reflect.KMutableProperty0
|
||||
|
||||
@ -152,7 +151,7 @@ open class Stats(
|
||||
|
||||
/** Since notifications are translated on the fly, when saving stats there we need to do so in English */
|
||||
fun toStringForNotifications() = this.joinToString {
|
||||
(if (it.value > 0) "+" else "") + it.value.toInt() + " " + it.key.toString().tr(Constants.english)
|
||||
(if (it.value > 0) "+" else "") + it.value.toInt() + " " + it.key.toString()
|
||||
}
|
||||
|
||||
// For display in diplomacy window
|
||||
|
@ -291,7 +291,8 @@ object TranslationActiveModsCache {
|
||||
* defaults to the input string if no translation is available,
|
||||
* but with placeholder or sentence brackets removed.
|
||||
*/
|
||||
fun String.tr(language:String = UncivGame.Current.settings.language): String {
|
||||
fun String.tr(): String {
|
||||
val language:String = UncivGame.Current.settings.language
|
||||
if (contains('<') && contains('>')) { // Conditionals!
|
||||
/**
|
||||
* So conditionals can contain placeholders, such as <vs [unitFilter] units>, which themselves
|
||||
|
Reference in New Issue
Block a user