From fe67dfa1c4c6c58649713049b1516ceb22873fe1 Mon Sep 17 00:00:00 2001 From: will-ca Date: Sun, 23 Jan 2022 00:39:28 -0800 Subject: [PATCH] Make "Help" button clearer and translatable, random nation indicators and labels translatable. (#6013) * Make unknown nation placeholder translatable. * Make MultiplayerScreen help button clearer and translatable. * Use `Constants.spectator` more. * Make random/unknown nation icon translatable. --- android/assets/jsons/translations/template.properties | 7 +++++++ core/src/com/unciv/Constants.kt | 1 + core/src/com/unciv/models/simulation/Simulation.kt | 3 ++- core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt | 2 +- .../com/unciv/ui/overviewscreen/EmpireOverviewScreen.kt | 2 +- .../com/unciv/ui/overviewscreen/ReligionOverviewTable.kt | 5 +++-- core/src/com/unciv/ui/victoryscreen/VictoryScreen.kt | 3 ++- desktop/src/com/unciv/app/desktop/ConsoleLauncher.kt | 3 ++- 8 files changed, 19 insertions(+), 7 deletions(-) diff --git a/android/assets/jsons/translations/template.properties b/android/assets/jsons/translations/template.properties index 7597dd4f9b..f89a328b75 100644 --- a/android/assets/jsons/translations/template.properties +++ b/android/assets/jsons/translations/template.properties @@ -344,6 +344,10 @@ Cultural = Diplomatic = Time = +# Used for random nation indicator in empire selector and unknown nation icons in various overview screens. +# Should be a single character, or at least visually square. +? = + Map Shape = Hexagonal = Rectangular = @@ -429,6 +433,7 @@ Anything above 40 may work very slowly on Android! = # Multiplayer +Help = Username = Multiplayer = Could not download game! = @@ -752,6 +757,8 @@ We Love The King Day = [year] BC = [year] AD = Civilopedia = +# Display name of unknown nations. +??? = Start new game = Save game = diff --git a/core/src/com/unciv/Constants.kt b/core/src/com/unciv/Constants.kt index 1ac062ab71..09b98cd355 100644 --- a/core/src/com/unciv/Constants.kt +++ b/core/src/com/unciv/Constants.kt @@ -37,6 +37,7 @@ object Constants { const val researchAgreement = "Research Agreement" const val openBorders = "Open Borders" const val random = "Random" + const val unknownNationName = "???" const val fort = "Fort" const val citadel = "Citadel" diff --git a/core/src/com/unciv/models/simulation/Simulation.kt b/core/src/com/unciv/models/simulation/Simulation.kt index 348356d2e9..47a6d6cc4a 100644 --- a/core/src/com/unciv/models/simulation/Simulation.kt +++ b/core/src/com/unciv/models/simulation/Simulation.kt @@ -1,5 +1,6 @@ package com.unciv.models.simulation +import com.unciv.Constants import com.unciv.logic.GameInfo import com.unciv.logic.GameStarter import com.unciv.models.ruleset.VictoryType @@ -17,7 +18,7 @@ class Simulation( private val maxTurns: Int = 1000 ) { private val maxSimulations = threadsNumber * simulationsPerThread - val civilizations = newGameInfo.civilizations.filter { it.civName != "Spectator" }.map { it.civName } + val civilizations = newGameInfo.civilizations.filter { it.civName != Constants.spectator }.map { it.civName } private var startTime: Long = 0 private var endTime: Long = 0 var steps = ArrayList() diff --git a/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt b/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt index f95e2414ac..266b6d3c4c 100644 --- a/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt +++ b/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt @@ -40,7 +40,7 @@ class MultiplayerScreen(previousScreen: BaseScreen) : PickerScreen() { //Help Button Setup val tab = Table() - val helpButton = "?".toTextButton() + val helpButton = "Help".toTextButton() helpButton.onClick { val helpPopup = Popup(this) helpPopup.addGoodSizedLabel("To create a multiplayer game, check the 'multiplayer' toggle in the New Game screen, and for each human player insert that player's user ID.").row() diff --git a/core/src/com/unciv/ui/overviewscreen/EmpireOverviewScreen.kt b/core/src/com/unciv/ui/overviewscreen/EmpireOverviewScreen.kt index f9194aef70..5f611da339 100644 --- a/core/src/com/unciv/ui/overviewscreen/EmpireOverviewScreen.kt +++ b/core/src/com/unciv/ui/overviewscreen/EmpireOverviewScreen.kt @@ -134,7 +134,7 @@ class EmpireOverviewScreen(private var viewingPlayer:CivilizationInfo, defaultPa } else { civGroup.add(ImageGetter.getRandomNationIndicator(30f)) backgroundColor = Color.DARK_GRAY - labelText = "???" + labelText = Constants.unknownNationName } civGroup.background = ImageGetter.getRoundedEdgeRectangle(backgroundColor) diff --git a/core/src/com/unciv/ui/overviewscreen/ReligionOverviewTable.kt b/core/src/com/unciv/ui/overviewscreen/ReligionOverviewTable.kt index 737f05b6a5..1169e5f312 100644 --- a/core/src/com/unciv/ui/overviewscreen/ReligionOverviewTable.kt +++ b/core/src/com/unciv/ui/overviewscreen/ReligionOverviewTable.kt @@ -2,6 +2,7 @@ package com.unciv.ui.overviewscreen import com.badlogic.gdx.scenes.scene2d.ui.Button import com.badlogic.gdx.scenes.scene2d.ui.Table +import com.unciv.Constants import com.unciv.UncivGame import com.unciv.logic.civilization.CivilizationInfo import com.unciv.logic.civilization.ReligionState @@ -111,7 +112,7 @@ class ReligionOverviewTable( val foundingCivName = if (viewingPlayer.knows(religion.foundingCivName) || viewingPlayer.civName == religion.foundingCivName) religion.foundingCivName - else "???" + else Constants.unknownNationName statsTable.add(foundingCivName.toLabel()).right().pad(5f).row() if (religion.isMajorReligion()) { val holyCity = gameInfo.getCities().firstOrNull { it.religion.religionThisIsTheHolyCityOf == religion.name } @@ -120,7 +121,7 @@ class ReligionOverviewTable( val cityName = if (viewingPlayer.exploredTiles.contains(holyCity.getCenterTile().position)) holyCity.name - else "???" + else Constants.unknownNationName statsTable.add(cityName.toLabel()).right().pad(5f).row() } } diff --git a/core/src/com/unciv/ui/victoryscreen/VictoryScreen.kt b/core/src/com/unciv/ui/victoryscreen/VictoryScreen.kt index 632376a3f9..44d0451aee 100644 --- a/core/src/com/unciv/ui/victoryscreen/VictoryScreen.kt +++ b/core/src/com/unciv/ui/victoryscreen/VictoryScreen.kt @@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.Color import com.badlogic.gdx.scenes.scene2d.ui.Table import com.badlogic.gdx.scenes.scene2d.ui.TextButton import com.badlogic.gdx.utils.Align +import com.unciv.Constants import com.unciv.logic.civilization.CivilizationInfo import com.unciv.models.ruleset.Policy import com.unciv.models.ruleset.VictoryType @@ -158,7 +159,7 @@ class VictoryScreen(val worldScreen: WorldScreen) : PickerScreen() { if (civ.isCurrentPlayer() || !civ.isMajorCiv()) continue val civName = if (playerCivInfo.diplomacy.containsKey(civ.civName)) civ.civName - else "???" + else Constants.unknownNationName table.add(getMilestone("Destroy [$civName]", civ.isDefeated())).row() } return table diff --git a/desktop/src/com/unciv/app/desktop/ConsoleLauncher.kt b/desktop/src/com/unciv/app/desktop/ConsoleLauncher.kt index 8b483763af..03b1f2eb3c 100644 --- a/desktop/src/com/unciv/app/desktop/ConsoleLauncher.kt +++ b/desktop/src/com/unciv/app/desktop/ConsoleLauncher.kt @@ -1,5 +1,6 @@ package com.unciv.app.desktop +import com.unciv.Constants import com.unciv.UncivGame import com.unciv.UncivGameParameters import com.unciv.logic.GameStarter @@ -79,7 +80,7 @@ internal object ConsoleLauncher { }) add(Player().apply { playerType = PlayerType.Human - chosenCiv = "Spectator" + chosenCiv = Constants.spectator }) } }