From f53435e612e0f3fcd3cac8f4958f3f47800e0537 Mon Sep 17 00:00:00 2001 From: logic <56484801+logicminimal@users.noreply.github.com> Date: Tue, 2 Nov 2021 18:24:37 +0300 Subject: [PATCH] Made rich presence text not change with language (#5613) * update for no reason * bruuhhhhhhhhh * bruuhhhhhhhhh * rebase... this probably wont work * bruuhhhhhhhhh * fix comments..? * bruuhhhhhhhhh * equalize with upstream/master * made the game not change the text shown in rich presence with the current language, added a language override functionality to String.tr() which is probably inefficient as hell, also the reason why i had to keep the .tr in leader name is because it showed the parantheses * i have no idea why github or git keeps bugging me on this but this line randomly appears then disappears * i have no idea why github or git keeps bugging me on this but this line randomly appears then disappears * revert changes to .tr(), use what @yairm210 suggested --- android/assets/jsons/translations/Italian.properties | 1 + core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt | 1 + desktop/src/com/unciv/app/desktop/DesktopLauncher.kt | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/android/assets/jsons/translations/Italian.properties b/android/assets/jsons/translations/Italian.properties index 7d21998f0b..52a117b63a 100644 --- a/android/assets/jsons/translations/Italian.properties +++ b/android/assets/jsons/translations/Italian.properties @@ -5231,3 +5231,4 @@ Once active, the game's year display will use mayan notation. = Quando attivato, The Maya measured time in days from what we would call 11th of August, 3114 BCE. A day is called K'in, 20 days are a Winal, 18 Winals are a Tun, 20 Tuns are a K'atun, 20 K'atuns are a B'ak'tun, 20 B'ak'tuns a Piktun, and so on. = I Maya misuravano il tempo in giorni da quello che chiameremmo l'11 agosto 3114 a.C. Un giorno si chiama K'in, 20 giorni un Winal, 18 Winal un Tun, 20 Tun un K'atun, 20 K'atun un B'ak'tun, 20 B'ak'tun un Piktun e via discorrendo. Unciv only displays ය B'ak'tuns, ඹ K'atuns and ම Tuns (from left to right) since that is enough to approximate gregorian calendar years. The Maya numerals are pretty obvious to understand. Have fun deciphering them! = Unciv visualizza solo ය B'ak'tun, ඹ K'atun e ම Tun (da sinistra a destra) in quanto sufficienti per approssimare gli anni del calendario gregoriano. Se vuoi puoi provare a decifrare i numeri maya: non sembrano difficili da decrifrare. + diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt index 02b386e68f..1614b242cf 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt @@ -259,6 +259,7 @@ class WorldScreenTopBar(val worldScreen: WorldScreen) : Table() { val nation = worldScreen.gameInfo.ruleSet.nations[worldScreen.selectedCiv.civName]!! val selectedCivIcon = ImageGetter.getNationIndicator(nation, 35f) selectedCivIconHolder.actor = selectedCivIcon + selectedCivIconHolder.onClick { worldScreen.game.setScreen(EmpireOverviewScreen(worldScreen.selectedCiv)) } } private fun getCultureText(civInfo: CivilizationInfo, nextTurnStats: Stats): String { diff --git a/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt b/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt index b2080c7bda..18d407d54a 100644 --- a/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt +++ b/desktop/src/com/unciv/app/desktop/DesktopLauncher.kt @@ -85,9 +85,9 @@ internal object DesktopLauncher { if (!game.isInitialized) return val presence = DiscordRichPresence() val currentPlayerCiv = game.gameInfo.getCurrentPlayerCivilization() - presence.details = currentPlayerCiv.nation.getLeaderDisplayName().tr() + presence.details = "${currentPlayerCiv.nation.leaderName} of ${currentPlayerCiv.nation.name}" presence.largeImageKey = "logo" // The actual image is uploaded to the discord app / applications webpage - presence.largeImageText = "Turn".tr() + " " + currentPlayerCiv.gameInfo.turns + presence.largeImageText = "Turn" + " " + currentPlayerCiv.gameInfo.turns DiscordRPC.INSTANCE.Discord_UpdatePresence(presence) } }