mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-20 04:38:18 +07:00
chore: diplomatic modifier text auto-translated
This commit is contained in:
@ -168,36 +168,6 @@ Ally =
|
|||||||
Current leader is [civInfo] with [amount] [stat] generated. =
|
Current leader is [civInfo] with [amount] [stat] generated. =
|
||||||
Current leader is [civInfo] with [amount] Technologies discovered. =
|
Current leader is [civInfo] with [amount] Technologies discovered. =
|
||||||
|
|
||||||
## Diplomatic modifiers
|
|
||||||
|
|
||||||
You declared war on us! =
|
|
||||||
Your warmongering ways are unacceptable to us. =
|
|
||||||
You have captured our cities! =
|
|
||||||
We applaud your liberation of our conquered cities! =
|
|
||||||
We applaud your liberation of conquered cities! =
|
|
||||||
Years of peace have strengthened our relations. =
|
|
||||||
Our mutual military struggle brings us closer together. =
|
|
||||||
We have signed a public declaration of friendship =
|
|
||||||
You have declared friendship with our enemies! =
|
|
||||||
You have declared friendship with our allies =
|
|
||||||
Our open borders have brought us closer together. =
|
|
||||||
Your so-called 'friendship' is worth nothing. =
|
|
||||||
You have publicly denounced us! =
|
|
||||||
You have denounced our allies =
|
|
||||||
You have denounced our enemies =
|
|
||||||
You betrayed your promise to not settle cities near us =
|
|
||||||
You fulfilled your promise to stop settling cities near us! =
|
|
||||||
You refused to stop settling cities near us =
|
|
||||||
Your arrogant demands are in bad taste =
|
|
||||||
Your use of nuclear weapons is disgusting! =
|
|
||||||
You have stolen our lands! =
|
|
||||||
You gave us units! =
|
|
||||||
You destroyed City-States that were under our protection! =
|
|
||||||
You attacked City-States that were under our protection! =
|
|
||||||
You demanded tribute from City-States that were under our protection! =
|
|
||||||
You sided with a City-State over us =
|
|
||||||
You returned captured units to us =
|
|
||||||
|
|
||||||
Demands =
|
Demands =
|
||||||
Please don't settle new cities near us. =
|
Please don't settle new cities near us. =
|
||||||
Very well, we shall look for new lands to settle. =
|
Very well, we shall look for new lands to settle. =
|
||||||
|
@ -4,6 +4,7 @@ import com.badlogic.gdx.Gdx
|
|||||||
import com.badlogic.gdx.files.FileHandle
|
import com.badlogic.gdx.files.FileHandle
|
||||||
import com.unciv.json.fromJsonFile
|
import com.unciv.json.fromJsonFile
|
||||||
import com.unciv.json.json
|
import com.unciv.json.json
|
||||||
|
import com.unciv.logic.civilization.diplomacy.DiplomaticModifiers
|
||||||
import com.unciv.logic.civilization.managers.SpyAction
|
import com.unciv.logic.civilization.managers.SpyAction
|
||||||
import com.unciv.models.metadata.BaseRuleset
|
import com.unciv.models.metadata.BaseRuleset
|
||||||
import com.unciv.models.metadata.LocaleCode
|
import com.unciv.models.metadata.LocaleCode
|
||||||
@ -89,6 +90,15 @@ object TranslationFileWriter {
|
|||||||
if (templateFile.exists())
|
if (templateFile.exists())
|
||||||
linesToTranslate.addAll(templateFile.reader(TranslationFileReader.charset).readLines())
|
linesToTranslate.addAll(templateFile.reader(TranslationFileReader.charset).readLines())
|
||||||
|
|
||||||
|
linesToTranslate += "\n\n#################### Lines from Unique Types #######################\n"
|
||||||
|
for (uniqueType in UniqueType.values()) {
|
||||||
|
val deprecationAnnotation = uniqueType.getDeprecationAnnotation()
|
||||||
|
if (deprecationAnnotation != null) continue
|
||||||
|
if (uniqueType.flags.contains(UniqueFlag.HiddenToUsers)) continue
|
||||||
|
|
||||||
|
linesToTranslate += "${uniqueType.getTranslatable()} = "
|
||||||
|
}
|
||||||
|
|
||||||
for (uniqueParameterType in UniqueParameterType.values()) {
|
for (uniqueParameterType in UniqueParameterType.values()) {
|
||||||
val strings = uniqueParameterType.getTranslationWriterStringsForOutput()
|
val strings = uniqueParameterType.getTranslationWriterStringsForOutput()
|
||||||
if (strings.isEmpty()) continue
|
if (strings.isEmpty()) continue
|
||||||
@ -96,6 +106,19 @@ object TranslationFileWriter {
|
|||||||
linesToTranslate.addAll(strings.map { "$it = " })
|
linesToTranslate.addAll(strings.map { "$it = " })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (uniqueTarget in UniqueTarget.values())
|
||||||
|
linesToTranslate += "$uniqueTarget = "
|
||||||
|
|
||||||
|
linesToTranslate += "\n\n#################### Lines from spy actions #######################\n"
|
||||||
|
for (spyAction in SpyAction.values()) {
|
||||||
|
linesToTranslate += "$spyAction = "
|
||||||
|
}
|
||||||
|
|
||||||
|
linesToTranslate += "\n\n#################### Lines from diplomatic modifiers #######################\n"
|
||||||
|
for (diplomaticModifier in DiplomaticModifiers.values())
|
||||||
|
linesToTranslate += "${diplomaticModifier.text} = "
|
||||||
|
|
||||||
|
|
||||||
for (baseRuleset in BaseRuleset.values()) {
|
for (baseRuleset in BaseRuleset.values()) {
|
||||||
val generatedStringsFromBaseRuleset =
|
val generatedStringsFromBaseRuleset =
|
||||||
GenerateStringsFromJSONs(Gdx.files.local("jsons/${baseRuleset.fullName}"))
|
GenerateStringsFromJSONs(Gdx.files.local("jsons/${baseRuleset.fullName}"))
|
||||||
@ -112,29 +135,11 @@ object TranslationFileWriter {
|
|||||||
|
|
||||||
for ((key, value) in fileNameToGeneratedStrings) {
|
for ((key, value) in fileNameToGeneratedStrings) {
|
||||||
if (value.isEmpty()) continue
|
if (value.isEmpty()) continue
|
||||||
linesToTranslate.add("\n#################### Lines from $key ####################\n")
|
linesToTranslate += "\n#################### Lines from $key ####################\n"
|
||||||
linesToTranslate.addAll(value)
|
linesToTranslate.addAll(value)
|
||||||
}
|
}
|
||||||
fileNameToGeneratedStrings.clear() // No longer needed
|
fileNameToGeneratedStrings.clear() // No longer needed
|
||||||
|
|
||||||
if (modFolder == null) { // base game
|
|
||||||
linesToTranslate.add("\n\n#################### Lines from Unique Types #######################\n")
|
|
||||||
for (uniqueType in UniqueType.values()) {
|
|
||||||
val deprecationAnnotation = uniqueType.getDeprecationAnnotation()
|
|
||||||
if (deprecationAnnotation != null) continue
|
|
||||||
if (uniqueType.flags.contains(UniqueFlag.HiddenToUsers)) continue
|
|
||||||
|
|
||||||
linesToTranslate.add("${uniqueType.getTranslatable()} = ")
|
|
||||||
}
|
|
||||||
|
|
||||||
for (uniqueTarget in UniqueTarget.values())
|
|
||||||
linesToTranslate.add("$uniqueTarget = ")
|
|
||||||
|
|
||||||
for (spyAction in SpyAction.values()) {
|
|
||||||
linesToTranslate.add("$spyAction = ")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var countOfTranslatableLines = 0
|
var countOfTranslatableLines = 0
|
||||||
val countOfTranslatedLines = HashMap<String, Int>()
|
val countOfTranslatedLines = HashMap<String, Int>()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user