diff --git a/android/vcmi-app/src/main/java/eu/vcmi/vcmi/settings/LanguageSettingDialog.java b/android/vcmi-app/src/main/java/eu/vcmi/vcmi/settings/LanguageSettingDialog.java index 98bbcd9b2..aed0a60d3 100644 --- a/android/vcmi-app/src/main/java/eu/vcmi/vcmi/settings/LanguageSettingDialog.java +++ b/android/vcmi-app/src/main/java/eu/vcmi/vcmi/settings/LanguageSettingDialog.java @@ -30,6 +30,7 @@ public class LanguageSettingDialog extends LauncherSettingDialog AVAILABLE_LANGUAGES.add("swedish"); AVAILABLE_LANGUAGES.add("turkish"); AVAILABLE_LANGUAGES.add("ukrainian"); + AVAILABLE_LANGUAGES.add("vietnamese"); AVAILABLE_LANGUAGES.add("other_cp1250"); AVAILABLE_LANGUAGES.add("other_cp1251"); AVAILABLE_LANGUAGES.add("other_cp1252"); diff --git a/config/schemas/mod.json b/config/schemas/mod.json index 9c0d5b4e3..2c1fc8501 100644 --- a/config/schemas/mod.json +++ b/config/schemas/mod.json @@ -153,7 +153,7 @@ "language" : { "type" : "string", "description" : "Base language of the mod, before applying localizations. By default vcmi assumes English", - "enum" : [ "czech", "chinese", "english", "finnish", "french", "german", "hungarian", "italian", "korean", "polish", "portuguese", "russian", "spanish", "swedish", "turkish", "ukrainian" ] + "enum" : [ "czech", "chinese", "english", "finnish", "french", "german", "hungarian", "italian", "korean", "polish", "portuguese", "russian", "spanish", "swedish", "turkish", "ukrainian", "vietnamese" ] }, "czech" : { "$ref" : "#/definitions/localizable" @@ -203,6 +203,9 @@ "ukrainian" : { "$ref" : "#/definitions/localizable" }, + "vietnamese" : { + "$ref" : "#/definitions/localizable" + }, "translations" : { "type" : "array", "description" : "List of files with translations for this language", diff --git a/config/schemas/settings.json b/config/schemas/settings.json index ef234a135..ca30b8c02 100644 --- a/config/schemas/settings.json +++ b/config/schemas/settings.json @@ -63,12 +63,12 @@ }, "language" : { "type" : "string", - "enum" : [ "english", "czech", "chinese", "finnish", "french", "german", "hungarian", "italian", "korean", "polish", "portuguese", "russian", "spanish", "swedish", "turkish", "ukrainian" ], + "enum" : [ "english", "czech", "chinese", "finnish", "french", "german", "hungarian", "italian", "korean", "polish", "portuguese", "russian", "spanish", "swedish", "turkish", "ukrainian", "vietnamese" ], "default" : "english" }, "gameDataLanguage" : { "type" : "string", - "enum" : [ "auto", "english", "czech", "chinese", "finnish", "french", "german", "hungarian", "italian", "korean", "polish", "portuguese", "russian", "spanish", "swedish", "turkish", "ukrainian", "other_cp1250", "other_cp1251", "other_cp1252" ], + "enum" : [ "auto", "english", "czech", "chinese", "finnish", "french", "german", "hungarian", "italian", "korean", "polish", "portuguese", "russian", "spanish", "swedish", "turkish", "ukrainian", "vietnamese", "other_cp1250", "other_cp1251", "other_cp1252" ], "default" : "auto" }, "lastSave" : { diff --git a/launcher/languages.cpp b/launcher/languages.cpp index 8c7174df3..670faa345 100644 --- a/launcher/languages.cpp +++ b/launcher/languages.cpp @@ -18,7 +18,7 @@ #include // list of language names, for generation of translations. Do not use directly, use Languages namespace instead -static const std::array languageTranslatedNamesGenerator = { +static const std::array languageTranslatedNamesGenerator = { { QT_TRANSLATE_NOOP("Language", "Czech"), QT_TRANSLATE_NOOP("Language", "Chinese"), @@ -36,6 +36,7 @@ static const std::array languageTranslatedNamesGenerator = { QT_TRANSLATE_NOOP("Language", "Swedish"), QT_TRANSLATE_NOOP("Language", "Turkish"), QT_TRANSLATE_NOOP("Language", "Ukrainian"), + QT_TRANSLATE_NOOP("Language", "Vietnamese"), QT_TRANSLATE_NOOP("Language", "Other (East European)"), QT_TRANSLATE_NOOP("Language", "Other (Cyrillic Script)"), QT_TRANSLATE_NOOP("Language", "Other (West European)"), diff --git a/lib/Languages.h b/lib/Languages.h index 245430857..d00ce6ff7 100644 --- a/lib/Languages.h +++ b/lib/Languages.h @@ -30,6 +30,7 @@ enum class ELanguages SWEDISH, TURKISH, UKRAINIAN, + VIETNAMESE, // Pseudo-languages, that have no translations but can define H3 encoding to use OTHER_CP1250, @@ -62,7 +63,7 @@ struct Options inline const auto & getLanguageList() { - static const std::array languages + static const std::array languages { { { "czech", "Czech", "Čeština", "CP1250", "cs", true }, { "chinese", "Chinese", "简体中文", "GBK", "zh", true }, // Note: actually Simplified Chinese @@ -80,6 +81,7 @@ inline const auto & getLanguageList() { "swedish", "Swedish", "Svenska", "CP1252", "sv", true }, { "turkish", "Turkish", "Türkçe", "CP1254", "tr", true }, { "ukrainian", "Ukrainian", "Українська", "CP1251", "uk", true }, + { "vietnamese", "Vietnamese", "Tiếng Việt", "UTF-8", "vi", true }, // Fan translation uses special encoding { "other_cp1250", "Other (East European)", "", "CP1250", "", false }, { "other_cp1251", "Other (Cyrillic Script)", "", "CP1251", "", false },