mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Update translationFileWriter to include missing strings (#4578)
* Update translationFileWriter to include strings from new json files * Fix promotions with multiple uniques not getting translated * Add missing translatable strings (thanks to DuffLagerleff for finding these)
This commit is contained in:
parent
239a406bc4
commit
3d13680602
@ -566,12 +566,13 @@ No =
|
|||||||
Acquire =
|
Acquire =
|
||||||
Under construction =
|
Under construction =
|
||||||
|
|
||||||
Gold =
|
|
||||||
Science =
|
|
||||||
Happiness =
|
|
||||||
Production =
|
|
||||||
Culture =
|
|
||||||
Food =
|
Food =
|
||||||
|
Production =
|
||||||
|
Gold =
|
||||||
|
Happiness =
|
||||||
|
Culture =
|
||||||
|
Science =
|
||||||
|
Faith =
|
||||||
|
|
||||||
Crop Yield =
|
Crop Yield =
|
||||||
Territory =
|
Territory =
|
||||||
@ -739,6 +740,7 @@ Luxury resource =
|
|||||||
Strategic resource =
|
Strategic resource =
|
||||||
Fresh water =
|
Fresh water =
|
||||||
non-fresh water =
|
non-fresh water =
|
||||||
|
Natural Wonder =
|
||||||
|
|
||||||
# improvementFilters
|
# improvementFilters
|
||||||
|
|
||||||
@ -938,6 +940,10 @@ All policies adopted =
|
|||||||
Choose an Icon and name for your Religion =
|
Choose an Icon and name for your Religion =
|
||||||
Choose a [$beliefType] belief! =
|
Choose a [$beliefType] belief! =
|
||||||
Found [religionName] =
|
Found [religionName] =
|
||||||
|
Choose a pantheon =
|
||||||
|
Found Religion =
|
||||||
|
Found Pantheon =
|
||||||
|
Follow [belief] =
|
||||||
|
|
||||||
# Terrains
|
# Terrains
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ class Promotion : INamed{
|
|||||||
var effect = ""
|
var effect = ""
|
||||||
var unitTypes = listOf<String>() // The json parser wouldn't agree to deserialize this as a list of UnitTypes. =(
|
var unitTypes = listOf<String>() // The json parser wouldn't agree to deserialize this as a list of UnitTypes. =(
|
||||||
|
|
||||||
var uniques = listOf<String>()
|
var uniques = ArrayList<String>()
|
||||||
val uniqueObjects: List<Unique> by lazy { uniques.map { Unique(it) } + Unique(effect) }
|
val uniqueObjects: List<Unique> by lazy { uniques.map { Unique(it) } + Unique(effect) }
|
||||||
|
|
||||||
fun getDescription(promotionsForUnitType: Collection<Promotion>, forCivilopedia:Boolean=false, ruleSet:Ruleset? = null):String {
|
fun getDescription(promotionsForUnitType: Collection<Promotion>, forCivilopedia:Boolean=false, ruleSet:Ruleset? = null):String {
|
||||||
|
@ -222,6 +222,7 @@ object TranslationFileWriter {
|
|||||||
|| parameter == "non-fresh water"
|
|| parameter == "non-fresh water"
|
||||||
|| parameter == "Open Terrain"
|
|| parameter == "Open Terrain"
|
||||||
|| parameter == "Rough Terrain"
|
|| parameter == "Rough Terrain"
|
||||||
|
|| parameter == "Natural Wonder"
|
||||||
-> "tileFilter"
|
-> "tileFilter"
|
||||||
RulesetCache.getBaseRuleset().units.containsKey(parameter) -> "unit"
|
RulesetCache.getBaseRuleset().units.containsKey(parameter) -> "unit"
|
||||||
RulesetCache.getBaseRuleset().tileImprovements.containsKey(parameter)
|
RulesetCache.getBaseRuleset().tileImprovements.containsKey(parameter)
|
||||||
@ -280,6 +281,10 @@ object TranslationFileWriter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun serializeElement(element: Any) {
|
fun serializeElement(element: Any) {
|
||||||
|
if (element is String) {
|
||||||
|
submitString(element)
|
||||||
|
return
|
||||||
|
}
|
||||||
val allFields = (element.javaClass.declaredFields + element.javaClass.fields
|
val allFields = (element.javaClass.declaredFields + element.javaClass.fields
|
||||||
+ element.javaClass.superclass.declaredFields) // This is so the main PolicyBranch, which inherits from Policy, will recognize its Uniques and have them translated
|
+ element.javaClass.superclass.declaredFields) // This is so the main PolicyBranch, which inherits from Policy, will recognize its Uniques and have them translated
|
||||||
.filter {
|
.filter {
|
||||||
@ -333,11 +338,14 @@ object TranslationFileWriter {
|
|||||||
|
|
||||||
private fun getJavaClassByName(name: String): Class<Any> {
|
private fun getJavaClassByName(name: String): Class<Any> {
|
||||||
return when (name) {
|
return when (name) {
|
||||||
|
"Beliefs" -> emptyArray<Belief>().javaClass
|
||||||
"Buildings" -> emptyArray<Building>().javaClass
|
"Buildings" -> emptyArray<Building>().javaClass
|
||||||
"Difficulties" -> emptyArray<Difficulty>().javaClass
|
"Difficulties" -> emptyArray<Difficulty>().javaClass
|
||||||
|
"Eras" -> emptyArray<Era>().javaClass
|
||||||
"Nations" -> emptyArray<Nation>().javaClass
|
"Nations" -> emptyArray<Nation>().javaClass
|
||||||
"Policies" -> emptyArray<PolicyBranch>().javaClass
|
"Policies" -> emptyArray<PolicyBranch>().javaClass
|
||||||
"Quests" -> emptyArray<Quest>().javaClass
|
"Quests" -> emptyArray<Quest>().javaClass
|
||||||
|
"Religions" -> emptyArray<String>().javaClass
|
||||||
"Specialists" -> emptyArray<Specialist>().javaClass
|
"Specialists" -> emptyArray<Specialist>().javaClass
|
||||||
"Techs" -> emptyArray<TechColumn>().javaClass
|
"Techs" -> emptyArray<TechColumn>().javaClass
|
||||||
"Terrains" -> emptyArray<Terrain>().javaClass
|
"Terrains" -> emptyArray<Terrain>().javaClass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user