TranslationFileWriter

object TranslationFileWriter

Functions

equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
generateStringsFromJSONs
Link copied to clipboard
private fun generateStringsFromJSONs(jsonsFolder: FileHandle): LinkedHashMap<String, MutableSet<String>>
generateTranslationFiles
Link copied to clipboard
private fun generateTranslationFiles(translations: Translations, modFolder: FileHandle? = null, baseTranslations: Translations? = null): HashMap<String, Int>

Writes new language files per Mod or for BaseRuleset - only each language that exists in translations.

generateTutorialsStrings
Link copied to clipboard
private fun generateTutorialsStrings(): MutableSet<String>
getFileHandle
Link copied to clipboard
private fun getFileHandle(modFolder: FileHandle?, fileLocation: String): FileHandle
getGeneratedStringsSize
Link copied to clipboard
fun getGeneratedStringsSize(): Int
getJavaClassByName
Link copied to clipboard
private fun getJavaClassByName(name: String): Class<Any>
hashCode
Link copied to clipboard
open fun hashCode(): Int
isFieldTranslatable
Link copied to clipboard
private fun isFieldTranslatable(clazz: Class<*>, field: Field, fieldValue: Any?): Boolean

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

toString
Link copied to clipboard
open fun toString(): String
writeLanguagePercentages
Link copied to clipboard
private fun writeLanguagePercentages(percentages: HashMap<String, Int>, modFolder: FileHandle? = null)
writeNewTranslationFiles
Link copied to clipboard
fun writeNewTranslationFiles(): String

Properties

languageFileLocation
Link copied to clipboard
private const val languageFileLocation: String
specialNewLineCode
Link copied to clipboard
private const val specialNewLineCode: String
templateFileLocation
Link copied to clipboard
const val templateFileLocation: String
translatableEnumsSet
Link copied to clipboard
private val translatableEnumsSet: Set<String>

Specifies Enums where the name property is translatable, by Class name

untranslatableFieldSet
Link copied to clipboard
private val untranslatableFieldSet: Set<String>

Exclude fields by name that contain references to items defined elsewhere or are otherwise Strings but not user-displayed.

Sources

jvm source
Link copied to clipboard