Added neutral language file for strings that don't need translation

Dieser Commit ist enthalten in:
Reinder Feenstra 2023-07-04 22:21:53 +02:00
Ursprung 82f69a8406
Commit 45f26f55ba
5 geänderte Dateien mit 11 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -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();

Datei anzeigen

@ -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())
{

Datei anzeigen

@ -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();

Datei anzeigen

@ -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):

Datei anzeigen

@ -0,0 +1,2 @@
[
]