Added neutral language file for strings that don't need translation
Dieser Commit ist enthalten in:
Ursprung
82f69a8406
Commit
45f26f55ba
@ -99,15 +99,16 @@ int main(int argc, char* argv[])
|
||||
|
||||
const bool logMissingStrings = !DeveloperSettings::instance().logMissingStringsDir.value().isEmpty();
|
||||
|
||||
Locale* fallback = nullptr;
|
||||
const auto localePath = getLocalePath();
|
||||
Locale* fallback = new Locale(localePath / "neutral.lang");
|
||||
if(language != languageDefault && !DeveloperSettings::instance().dontLoadFallbackLanguage)
|
||||
{
|
||||
fallback = new Locale(getLocalePath() / languageDefault.toStdString().append(".lang"));
|
||||
fallback = new Locale(localePath / languageDefault.toStdString().append(".lang"), fallback);
|
||||
if(logMissingStrings)
|
||||
fallback->enableMissingLogging();
|
||||
}
|
||||
|
||||
Locale::instance = new Locale(getLocalePath() / language.toStdString().append(".lang"), fallback);
|
||||
Locale::instance = new Locale(localePath / language.toStdString().append(".lang"), fallback);
|
||||
if(logMissingStrings)
|
||||
const_cast<Locale*>(Locale::instance)->enableMissingLogging();
|
||||
|
||||
|
||||
@ -54,6 +54,8 @@ GeneralSettingsWidget::GeneralSettingsWidget(QWidget* parent)
|
||||
while(it.hasNext())
|
||||
{
|
||||
const QString filename = it.next();
|
||||
if(QFileInfo(filename).baseName() == "neutral")
|
||||
continue;
|
||||
const QString label = getLanguageName(filename);
|
||||
if(!label.isEmpty())
|
||||
{
|
||||
|
||||
@ -86,7 +86,8 @@ int main(int argc, char* argv[])
|
||||
}
|
||||
#endif
|
||||
|
||||
Locale::instance = new Locale(getLocalePath() / "en-us.lang");
|
||||
const auto localePath = getLocalePath();
|
||||
Locale::instance = new Locale(localePath / "en-us.lang", new Locale(localePath / "neutral.lang"));
|
||||
|
||||
if(enableConsoleLogger)
|
||||
Log::enableConsoleLogger();
|
||||
|
||||
@ -30,7 +30,7 @@ if __name__ == "__main__":
|
||||
import re
|
||||
path = os.path.realpath(os.path.dirname(__file__))
|
||||
for item in os.scandir(path):
|
||||
if re.match(r'^[a-z]{2}-[a-z]{2}\.json$', item.name) is not None:
|
||||
if re.match(r'^([a-z]{2}-[a-z]{2}|neutral)\.json$', item.name) is not None:
|
||||
filename_json = os.path.join(path, item.name)
|
||||
filename_lang = os.path.splitext(filename_json)[0] + '.lang'
|
||||
if not os.path.exists(filename_lang) or os.path.getmtime(filename_json) > os.path.getmtime(filename_lang):
|
||||
|
||||
2
shared/translations/neutral.json
Normale Datei
2
shared/translations/neutral.json
Normale Datei
@ -0,0 +1,2 @@
|
||||
[
|
||||
]
|
||||
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren