mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-31 23:29:53 +07: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:
@ -566,12 +566,13 @@ No =
|
||||
Acquire =
|
||||
Under construction =
|
||||
|
||||
Gold =
|
||||
Science =
|
||||
Happiness =
|
||||
Production =
|
||||
Culture =
|
||||
Food =
|
||||
Production =
|
||||
Gold =
|
||||
Happiness =
|
||||
Culture =
|
||||
Science =
|
||||
Faith =
|
||||
|
||||
Crop Yield =
|
||||
Territory =
|
||||
@ -739,6 +740,7 @@ Luxury resource =
|
||||
Strategic resource =
|
||||
Fresh water =
|
||||
non-fresh water =
|
||||
Natural Wonder =
|
||||
|
||||
# improvementFilters
|
||||
|
||||
@ -938,6 +940,10 @@ All policies adopted =
|
||||
Choose an Icon and name for your Religion =
|
||||
Choose a [$beliefType] belief! =
|
||||
Found [religionName] =
|
||||
Choose a pantheon =
|
||||
Found Religion =
|
||||
Found Pantheon =
|
||||
Follow [belief] =
|
||||
|
||||
# Terrains
|
||||
|
||||
|
@ -11,7 +11,7 @@ class Promotion : INamed{
|
||||
var effect = ""
|
||||
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) }
|
||||
|
||||
fun getDescription(promotionsForUnitType: Collection<Promotion>, forCivilopedia:Boolean=false, ruleSet:Ruleset? = null):String {
|
||||
|
@ -222,6 +222,7 @@ object TranslationFileWriter {
|
||||
|| parameter == "non-fresh water"
|
||||
|| parameter == "Open Terrain"
|
||||
|| parameter == "Rough Terrain"
|
||||
|| parameter == "Natural Wonder"
|
||||
-> "tileFilter"
|
||||
RulesetCache.getBaseRuleset().units.containsKey(parameter) -> "unit"
|
||||
RulesetCache.getBaseRuleset().tileImprovements.containsKey(parameter)
|
||||
@ -280,6 +281,10 @@ object TranslationFileWriter {
|
||||
}
|
||||
|
||||
fun serializeElement(element: Any) {
|
||||
if (element is String) {
|
||||
submitString(element)
|
||||
return
|
||||
}
|
||||
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
|
||||
.filter {
|
||||
@ -333,11 +338,14 @@ object TranslationFileWriter {
|
||||
|
||||
private fun getJavaClassByName(name: String): Class<Any> {
|
||||
return when (name) {
|
||||
"Beliefs" -> emptyArray<Belief>().javaClass
|
||||
"Buildings" -> emptyArray<Building>().javaClass
|
||||
"Difficulties" -> emptyArray<Difficulty>().javaClass
|
||||
"Eras" -> emptyArray<Era>().javaClass
|
||||
"Nations" -> emptyArray<Nation>().javaClass
|
||||
"Policies" -> emptyArray<PolicyBranch>().javaClass
|
||||
"Quests" -> emptyArray<Quest>().javaClass
|
||||
"Religions" -> emptyArray<String>().javaClass
|
||||
"Specialists" -> emptyArray<Specialist>().javaClass
|
||||
"Techs" -> emptyArray<TechColumn>().javaClass
|
||||
"Terrains" -> emptyArray<Terrain>().javaClass
|
||||
|
Reference in New Issue
Block a user