TranslationFileWriter
object TranslationFileWriter
Content copied to clipboard
Functions
generateStringsFromJSONs
Link copied to clipboard
private fun generateStringsFromJSONs(jsonsFolder: FileHandle): LinkedHashMap<String, MutableSet<String>>
Content copied to clipboard
generateTranslationFiles
Link copied to clipboard
private fun generateTranslationFiles(translations: Translations, modFolder: FileHandle? = null, baseTranslations: Translations? = null): HashMap<String, Int>
Content copied to clipboard
Writes new language files per Mod or for BaseRuleset - only each language that exists in translations.
generateTutorialsStrings
Link copied to clipboard
getFileHandle
Link copied to clipboard
private fun getFileHandle(modFolder: FileHandle?, fileLocation: String): FileHandle
Content copied to clipboard
getGeneratedStringsSize
Link copied to clipboard
getJavaClassByName
Link copied to clipboard
isFieldTranslatable
Link copied to clipboard
private fun isFieldTranslatable(clazz: Class<*>, field: Field, fieldValue: Any?): Boolean
Content copied to clipboard
Checks whether a field's value should be included in the translation templates. Applies explicit field exclusions from untranslatableFieldSet. The Modifier.STATIC exclusion removes fields from e.g. companion objects. Fields of enum types need that type explicitly allowed in translatableEnumsSet
writeLanguagePercentages
Link copied to clipboard
private fun writeLanguagePercentages(percentages: HashMap<String, Int>, modFolder: FileHandle? = null)
Content copied to clipboard
writeNewTranslationFiles
Link copied to clipboard
Properties
languageFileLocation
Link copied to clipboard
specialNewLineCode
Link copied to clipboard
templateFileLocation
Link copied to clipboard
translatableEnumsSet
Link copied to clipboard
untranslatableFieldSet
Link copied to clipboard
Sources
jvm source
Link copied to clipboard