1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Removed no longer needed pseudo-languages

This commit is contained in:
Ivan Savenko 2024-05-07 13:37:39 +00:00
parent b76c58c0b0
commit 9de6023224
5 changed files with 20 additions and 50 deletions

View File

@ -71,7 +71,7 @@
}, },
"gameDataLanguage" : { "gameDataLanguage" : {
"type" : "string", "type" : "string",
"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" ], "enum" : [ "auto", "english", "czech", "chinese", "finnish", "french", "german", "hungarian", "italian", "korean", "polish", "portuguese", "russian", "spanish", "swedish", "turkish", "ukrainian", "vietnamese" ],
"default" : "auto" "default" : "auto"
}, },
"lastSave" : { "lastSave" : {

View File

@ -18,7 +18,7 @@
#include <QListWidget> #include <QListWidget>
// list of language names, for generation of translations. Do not use directly, use Languages namespace instead // list of language names, for generation of translations. Do not use directly, use Languages namespace instead
static const std::array<std::string, 20> languageTranslatedNamesGenerator = { static const std::array<std::string, 17> languageTranslatedNamesGenerator = {
{ {
QT_TRANSLATE_NOOP("Language", "Czech"), QT_TRANSLATE_NOOP("Language", "Czech"),
QT_TRANSLATE_NOOP("Language", "Chinese"), QT_TRANSLATE_NOOP("Language", "Chinese"),
@ -37,9 +37,6 @@ static const std::array<std::string, 20> languageTranslatedNamesGenerator = {
QT_TRANSLATE_NOOP("Language", "Turkish"), QT_TRANSLATE_NOOP("Language", "Turkish"),
QT_TRANSLATE_NOOP("Language", "Ukrainian"), QT_TRANSLATE_NOOP("Language", "Ukrainian"),
QT_TRANSLATE_NOOP("Language", "Vietnamese"), 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)"),
} }
}; };
@ -73,9 +70,6 @@ QString Languages::generateLanguageName(const Languages::Options & language)
QString localizedName = QApplication::translate("Language", language.nameEnglish.c_str()); QString localizedName = QApplication::translate("Language", language.nameEnglish.c_str());
QString nativeName = language.nameNative.c_str(); QString nativeName = language.nameNative.c_str();
if(!language.hasTranslation)
return localizedName;
if(activeLanguage == language.identifier) if(activeLanguage == language.identifier)
return nativeName; return nativeName;
@ -105,9 +99,6 @@ void Languages::fillLanguages(QComboBox * widget, bool includeAll)
for(const auto & language : Languages::getLanguageList()) for(const auto & language : Languages::getLanguageList())
{ {
if (!language.hasTranslation && !includeAll)
continue;
QString displayName = generateLanguageName(language); QString displayName = generateLanguageName(language);
QVariant userData = QString::fromStdString(language.identifier); QVariant userData = QString::fromStdString(language.identifier);
@ -141,9 +132,6 @@ void Languages::fillLanguages(QListWidget * widget, bool includeAll)
for(const auto & language : Languages::getLanguageList()) for(const auto & language : Languages::getLanguageList())
{ {
if (!language.hasTranslation && !includeAll)
continue;
QString displayName = generateLanguageName(language); QString displayName = generateLanguageName(language);
QVariant userData = QString::fromStdString(language.identifier); QVariant userData = QString::fromStdString(language.identifier);

View File

@ -331,9 +331,6 @@ QString CModListView::genModInfoText(CModEntry & mod)
for(const auto & language : Languages::getLanguageList()) for(const auto & language : Languages::getLanguageList())
{ {
if (!language.hasTranslation)
continue;
QString languageID = QString::fromStdString(language.identifier); QString languageID = QString::fromStdString(language.identifier);
if (languageID != baseLanguageID && !mod.getValue(languageID).isValid()) if (languageID != baseLanguageID && !mod.getValue(languageID).isValid())

View File

@ -43,11 +43,6 @@ enum class ELanguages
UKRAINIAN, UKRAINIAN,
VIETNAMESE, VIETNAMESE,
// Pseudo-languages, that have no translations but can define H3 encoding to use
OTHER_CP1250,
OTHER_CP1251,
OTHER_CP1252,
COUNT COUNT
}; };
@ -73,36 +68,29 @@ struct Options
/// Ruleset for plural forms in this language /// Ruleset for plural forms in this language
EPluralForms pluralForms = EPluralForms::NONE; EPluralForms pluralForms = EPluralForms::NONE;
/// VCMI supports translations into this language
bool hasTranslation = false;
}; };
inline const auto & getLanguageList() inline const auto & getLanguageList()
{ {
static const std::array<Options, 20> languages static const std::array<Options, 17> languages
{ { { {
{ "czech", "Czech", "Čeština", "CP1250", "cs", "%d.%m.%Y %T", EPluralForms::CZ_3, true }, { "czech", "Czech", "Čeština", "CP1250", "cs", "%d.%m.%Y %T", EPluralForms::CZ_3 },
{ "chinese", "Chinese", "简体中文", "GBK", "zh", "%F %T", EPluralForms::VI_1, true }, // Note: actually Simplified Chinese { "chinese", "Chinese", "简体中文", "GBK", "zh", "%F %T", EPluralForms::VI_1 }, // Note: actually Simplified Chinese
{ "english", "English", "English", "CP1252", "en", "%F %T", EPluralForms::EN_2, true }, // English uses international date/time format here { "english", "English", "English", "CP1252", "en", "%F %T", EPluralForms::EN_2 }, // English uses international date/time format here
{ "finnish", "Finnish", "Suomi", "CP1252", "fi", "%d.%m.%Y %T", EPluralForms::EN_2, true }, { "finnish", "Finnish", "Suomi", "CP1252", "fi", "%d.%m.%Y %T", EPluralForms::EN_2 },
{ "french", "French", "Français", "CP1252", "fr", "%d/%m/%Y %T", EPluralForms::FR_2, true }, { "french", "French", "Français", "CP1252", "fr", "%d/%m/%Y %T", EPluralForms::FR_2 },
{ "german", "German", "Deutsch", "CP1252", "de", "%d.%m.%Y %T", EPluralForms::EN_2, true }, { "german", "German", "Deutsch", "CP1252", "de", "%d.%m.%Y %T", EPluralForms::EN_2 },
{ "hungarian", "Hungarian", "Magyar", "CP1250", "hu", "%Y. %m. %d. %T", EPluralForms::EN_2, true }, { "hungarian", "Hungarian", "Magyar", "CP1250", "hu", "%Y. %m. %d. %T", EPluralForms::EN_2 },
{ "italian", "Italian", "Italiano", "CP1250", "it", "%d/%m/%Y %T", EPluralForms::EN_2, true }, { "italian", "Italian", "Italiano", "CP1250", "it", "%d/%m/%Y %T", EPluralForms::EN_2 },
{ "korean", "Korean", "한국어", "CP949", "ko", "%F %T", EPluralForms::VI_1, true }, { "korean", "Korean", "한국어", "CP949", "ko", "%F %T", EPluralForms::VI_1 },
{ "polish", "Polish", "Polski", "CP1250", "pl", "%d.%m.%Y %T", EPluralForms::PL_3, true }, { "polish", "Polish", "Polski", "CP1250", "pl", "%d.%m.%Y %T", EPluralForms::PL_3 },
{ "portuguese", "Portuguese", "Português", "CP1252", "pt", "%d/%m/%Y %T", EPluralForms::EN_2, true }, // Note: actually Brazilian Portuguese { "portuguese", "Portuguese", "Português", "CP1252", "pt", "%d/%m/%Y %T", EPluralForms::EN_2 }, // Note: actually Brazilian Portuguese
{ "russian", "Russian", "Русский", "CP1251", "ru", "%d.%m.%Y %T", EPluralForms::UK_3, true }, { "russian", "Russian", "Русский", "CP1251", "ru", "%d.%m.%Y %T", EPluralForms::UK_3 },
{ "spanish", "Spanish", "Español", "CP1252", "es", "%d/%m/%Y %T", EPluralForms::EN_2, true }, { "spanish", "Spanish", "Español", "CP1252", "es", "%d/%m/%Y %T", EPluralForms::EN_2 },
{ "swedish", "Swedish", "Svenska", "CP1252", "sv", "%F %T", EPluralForms::EN_2, true }, { "swedish", "Swedish", "Svenska", "CP1252", "sv", "%F %T", EPluralForms::EN_2 },
{ "turkish", "Turkish", "Türkçe", "CP1254", "tr", "%d.%m.%Y %T", EPluralForms::EN_2, true }, { "turkish", "Turkish", "Türkçe", "CP1254", "tr", "%d.%m.%Y %T", EPluralForms::EN_2 },
{ "ukrainian", "Ukrainian", "Українська", "CP1251", "uk", "%d.%m.%Y %T", EPluralForms::UK_3, true }, { "ukrainian", "Ukrainian", "Українська", "CP1251", "uk", "%d.%m.%Y %T", EPluralForms::UK_3 },
{ "vietnamese", "Vietnamese", "Tiếng Việt", "UTF-8", "vi", "%d/%m/%Y %T", EPluralForms::VI_1, true }, // Fan translation uses special encoding { "vietnamese", "Vietnamese", "Tiếng Việt", "UTF-8", "vi", "%d/%m/%Y %T", EPluralForms::VI_1 }, // Fan translation uses special encoding
{ "other_cp1250", "Other (East European)", "", "CP1250", "", "", EPluralForms::NONE, false },
{ "other_cp1251", "Other (Cyrillic Script)", "", "CP1251", "", "", EPluralForms::NONE, false },
{ "other_cp1252", "Other (West European)", "", "CP1252", "", "", EPluralForms::NONE, false }
} }; } };
static_assert(languages.size() == static_cast<size_t>(ELanguages::COUNT), "Languages array is missing a value!"); static_assert(languages.size() == static_cast<size_t>(ELanguages::COUNT), "Languages array is missing a value!");

View File

@ -417,9 +417,6 @@ bool CModHandler::validateTranslations(TModID modName) const
for(const auto & language : Languages::getLanguageList()) for(const auto & language : Languages::getLanguageList())
{ {
if (!language.hasTranslation)
continue;
if (mod.config[language.identifier].isNull()) if (mod.config[language.identifier].isNull())
continue; continue;