mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-20 09:17:47 +07:00
Applied translation to many part of the project
This commit is contained in:
parent
c815863124
commit
e808885e0d
@ -5,6 +5,7 @@ import com.unciv.logic.automation.Automation
|
||||
import com.unciv.models.gamebasics.Building
|
||||
import com.unciv.models.gamebasics.GameBasics
|
||||
import com.unciv.models.stats.Stats
|
||||
import com.unciv.ui.utils.tr
|
||||
import java.util.*
|
||||
|
||||
|
||||
@ -44,14 +45,14 @@ class CityConstructions {
|
||||
fun getCityProductionTextForCityButton(): String {
|
||||
var result = currentConstruction
|
||||
if (result != "Science" && result != "Gold")
|
||||
result += "\r\n" + turnsToConstruction(currentConstruction) + " turns"
|
||||
result += "\r\n" + turnsToConstruction(currentConstruction) + " "+"turns".tr()
|
||||
return result
|
||||
}
|
||||
|
||||
fun getProductionForTileInfo(): String {
|
||||
var result = currentConstruction
|
||||
if (result != "Science" && result != "Gold")
|
||||
result += "\r\nin " + turnsToConstruction(currentConstruction) + " turns"
|
||||
result += "\r\nin " + turnsToConstruction(currentConstruction) + " "+"turns".tr()
|
||||
return result
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ import com.unciv.models.gamebasics.tile.Terrain
|
||||
import com.unciv.models.gamebasics.tile.TileImprovement
|
||||
import com.unciv.models.gamebasics.tile.TileResource
|
||||
import com.unciv.models.stats.Stats
|
||||
import com.unciv.ui.utils.tr
|
||||
|
||||
open class TileInfo {
|
||||
@Transient lateinit var tileMap: TileMap
|
||||
@ -156,7 +157,7 @@ open class TileInfo {
|
||||
if (hasViewableResource(tileMap.gameInfo.getPlayerCivilization())) SB.appendln(resource!!)
|
||||
if (roadStatus !== RoadStatus.None && !isCityCenter()) SB.appendln(roadStatus)
|
||||
if (improvement != null) SB.appendln(improvement!!)
|
||||
if (improvementInProgress != null) SB.appendln("$improvementInProgress in ${this.turnsToImprovement} turns")
|
||||
if (improvementInProgress != null) SB.appendln("$improvementInProgress in ${this.turnsToImprovement} "+"turns".tr())
|
||||
val isViewableToPlayer = UnCivGame.Current.gameInfo.getPlayerCivilization().getViewableTiles().contains(this)
|
||||
if (civilianUnit != null && isViewableToPlayer) SB.appendln(civilianUnit!!.name)
|
||||
if(militaryUnit!=null && isViewableToPlayer){
|
||||
|
@ -34,6 +34,6 @@ class Translations() : HashMap<String, HashMap<String, String>>(){
|
||||
}
|
||||
|
||||
fun getLanguages(): List<String> {
|
||||
return mutableListOf("English").apply { addAll(values.flatMap { it.keys }) }
|
||||
return mutableListOf("English").apply { addAll(values.flatMap { it.keys }.distinct()) }
|
||||
}
|
||||
}
|
@ -43,7 +43,7 @@ class LoadScreen : PickerScreen() {
|
||||
textToSet+="\nSaved at: "+ SimpleDateFormat("dd-MM-yy HH.mm").format(savedAt)
|
||||
try{
|
||||
val game = GameSaver().loadGame(it)
|
||||
textToSet+="\n"+game.getPlayerCivilization()+", turn "+game.turns
|
||||
textToSet+="\n"+game.getPlayerCivilization()+", ${"Turn".tr()} "+game.turns
|
||||
}catch (ex:Exception){
|
||||
textToSet+="\nCould not load game!"
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import com.unciv.logic.city.CityInfo
|
||||
import com.unciv.models.gamebasics.GameBasics
|
||||
import com.unciv.ui.cityscreen.CityScreen
|
||||
import com.unciv.ui.utils.addClickListener
|
||||
import com.unciv.ui.utils.tr
|
||||
|
||||
class ConstructionPickerScreen(val city: CityInfo) : PickerScreen() {
|
||||
private var selectedProduction: String? = null
|
||||
@ -49,7 +50,7 @@ class ConstructionPickerScreen(val city: CityInfo) : PickerScreen() {
|
||||
for (building in GameBasics.Buildings.values) {
|
||||
if (!building.isBuildable(cityConstructions) && building.name!=cityConstructions.currentConstruction) continue
|
||||
val productionTextButton = getProductionButton(building.name,
|
||||
building.name + "\r\n" + cityConstructions.turnsToConstruction(building.name) + " turns",
|
||||
building.name + "\r\n" + cityConstructions.turnsToConstruction(building.name) + " "+"turns".tr(),
|
||||
building.getDescription(true, civInfo.policies.getAdoptedPolicies()),
|
||||
"Build " + building.name)
|
||||
if (building.isWonder)
|
||||
@ -60,7 +61,7 @@ class ConstructionPickerScreen(val city: CityInfo) : PickerScreen() {
|
||||
|
||||
for (unit in GameBasics.Units.values.filter { it.isBuildable(cityConstructions)}) {
|
||||
units.addActor(getProductionButton(unit.name,
|
||||
unit.name + "\r\n" + cityConstructions.turnsToConstruction(unit.name) + " turns",
|
||||
unit.name + "\r\n" + cityConstructions.turnsToConstruction(unit.name) + " "+"turns".tr(),
|
||||
unit.getDescription(true), "Train " + unit.name))
|
||||
}
|
||||
|
||||
|
@ -7,10 +7,11 @@ import com.badlogic.gdx.utils.Align
|
||||
import com.unciv.ui.utils.CameraStageBaseScreen
|
||||
import com.unciv.ui.utils.addClickListener
|
||||
import com.unciv.ui.utils.disable
|
||||
import com.unciv.ui.utils.tr
|
||||
|
||||
open class PickerScreen : CameraStageBaseScreen() {
|
||||
|
||||
internal var closeButton: TextButton = TextButton("Close", CameraStageBaseScreen.skin)
|
||||
internal var closeButton: TextButton = TextButton("Close".tr(), CameraStageBaseScreen.skin)
|
||||
protected var descriptionLabel: Label
|
||||
protected var rightSideGroup = VerticalGroup()
|
||||
protected var rightSideButton: TextButton
|
||||
|
@ -9,6 +9,7 @@ import com.unciv.models.gamebasics.Technology
|
||||
import com.unciv.ui.utils.CameraStageBaseScreen
|
||||
import com.unciv.ui.utils.addClickListener
|
||||
import com.unciv.ui.utils.disable
|
||||
import com.unciv.ui.utils.tr
|
||||
import java.util.*
|
||||
|
||||
class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen() {
|
||||
@ -98,7 +99,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo) : PickerScreen()
|
||||
text += " (" + techsToResearch.indexOf(techName) + ")"
|
||||
}
|
||||
|
||||
if (!civTech.isResearched(techName)) text += "\r\n" + turnsToTech[techName] + " turns"
|
||||
if (!civTech.isResearched(techName)) text += "\r\n" + turnsToTech[techName] + " "+"turns".tr()
|
||||
TB.setText(text)
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ open class CameraStageBaseScreen : Screen {
|
||||
label.setAlignment(Align.center)
|
||||
tutorialTexts.removeAt(0)
|
||||
tutorialTable.add(label).pad(10f).row()
|
||||
val button = TextButton("Close", skin)
|
||||
val button = TextButton("Close".tr(), skin)
|
||||
button.addClickListener {
|
||||
tutorialTable.remove()
|
||||
if (!tutorialTexts.isEmpty())
|
||||
|
@ -96,7 +96,7 @@ class WorldScreen : CameraStageBaseScreen() {
|
||||
techButton.setText("Choose a tech!")
|
||||
else
|
||||
techButton.setText(civInfo.tech.currentTechnology() + "\r\n"
|
||||
+ civInfo.tech.turnsToTech(civInfo.tech.currentTechnology()!!) + " turns")
|
||||
+ civInfo.tech.turnsToTech(civInfo.tech.currentTechnology()!!) + " "+"turns".tr())
|
||||
|
||||
techButton.setSize(techButton.prefWidth, techButton.prefHeight)
|
||||
techButton.setPosition(10f, topBar.y - techButton.height - 5f)
|
||||
|
@ -113,7 +113,7 @@ class WorldScreenTopBar(val screen: WorldScreen) : Table() {
|
||||
else -> 2020+(turns-440)/2
|
||||
}
|
||||
|
||||
turnsLabel.setText("Turn " + civInfo.gameInfo.turns + " | "+ abs(year)+(if (year<0) " BCE" else " CE"))
|
||||
turnsLabel.setText("Turn".tr()+" " + civInfo.gameInfo.turns + " | "+ abs(year)+(if (year<0) " BCE" else " CE"))
|
||||
|
||||
val nextTurnStats = civInfo.getStatsForNextTurn()
|
||||
val goldPerTurn = "(" + (if (nextTurnStats.gold > 0) "+" else "") + Math.round(nextTurnStats.gold) + ")"
|
||||
|
@ -8,6 +8,7 @@ import com.unciv.logic.GameSaver
|
||||
import com.unciv.models.gamebasics.GameBasics
|
||||
import com.unciv.ui.utils.CameraStageBaseScreen
|
||||
import com.unciv.ui.utils.center
|
||||
import com.unciv.ui.utils.tr
|
||||
import com.unciv.ui.worldscreen.WorldScreen
|
||||
|
||||
class WorldScreenDisplayOptionsTable() : OptionsTable(){
|
||||
@ -42,7 +43,7 @@ class WorldScreenDisplayOptionsTable() : OptionsTable(){
|
||||
})
|
||||
|
||||
|
||||
addButton("Close"){ remove() }
|
||||
addButton("Close".tr()){ remove() }
|
||||
|
||||
pack() // Needed to show the background.
|
||||
center(UnCivGame.Current.worldScreen.stage)
|
||||
|
@ -28,7 +28,7 @@ class WorldScreenOptionsTable internal constructor() : OptionsTable() {
|
||||
|
||||
addButton("Victory status".tr()) { UnCivGame.Current.screen = VictoryScreen() }
|
||||
|
||||
addButton("Social Policies".tr()){
|
||||
addButton("Social policies".tr()){
|
||||
UnCivGame.Current.screen = PolicyPickerScreen(UnCivGame.Current.gameInfo.getPlayerCivilization())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user