diff options
Diffstat (limited to 'support/arara/source/src/main/kotlin/org/islandoftex/arara/localization/Language.kt')
-rw-r--r-- | support/arara/source/src/main/kotlin/org/islandoftex/arara/localization/Language.kt | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/support/arara/source/src/main/kotlin/org/islandoftex/arara/localization/Language.kt b/support/arara/source/src/main/kotlin/org/islandoftex/arara/localization/Language.kt deleted file mode 100644 index 2afa77c41e..0000000000 --- a/support/arara/source/src/main/kotlin/org/islandoftex/arara/localization/Language.kt +++ /dev/null @@ -1,69 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -package org.islandoftex.arara.localization - -import java.util.Locale -import org.islandoftex.arara.model.AraraException - -/** - * Implements the language model. - * - * @author Island of TeX - * @version 5.0 - * @since 4.0 - */ -class Language(code: String) { - // the language code, based on - // ISO 639-1 and language variants - private val code: String - - /** - * Gets the language name. - * - * @return A string representing the language name. - */ - val name: String - get() = languages.getValue(code).first - - /** - * Gets the language locale. - * - * @return The language locale. - */ - val locale: Locale - get() = languages.getValue(code).second - - // throws an exception on invalid language - init { - if (languages.containsKey(code)) { - this.code = code - } else { - throw AraraException( - LanguageController.getMessage( - Messages.ERROR_LANGUAGE_INVALID_CODE, - languagesList - ) - ) - } - } - - companion object { - // map containing all languages - // supported by arara - private val languages = mapOf( - "en" to Pair("English", Locale("en")), - "de" to Pair("German", Locale("de")), - "nl" to Pair("Dutch", Locale("nl")), - "qn" to Pair("Broad Norfolk", Locale("en", "QN")), - "ptbr" to Pair("Brazilian Portuguese", Locale("pt", "BR")), - "it" to Pair("Italian", Locale("it")) - ) - - /** - * String representing the list of available languages - * because they don't change initialized with the string - */ - val languagesList: String = "(" + languages.map { (key, value) -> - value.first + ": " + key - }.joinToString(", ") + ")" - } -} |