Skip to content
Snippets Groups Projects
Commit c8d9f0ba authored by Alexandre Lision's avatar Alexandre Lision Committed by gerrit2
Browse files

translations: fix wrong translations

Qt was nos taking into account english if another translated language was in
the system preferences list. We now check if english is defined as Primary
language.

Change-Id: Ia952778293a3942ea3aae9eae7c9da208d5e149e
Tuleap: #59
parent bf0385ee
No related branches found
No related tags found
No related merge requests found
......@@ -49,9 +49,16 @@ int main(int argc, const char *argv[]) {
app->setAttribute(Qt::AA_MacPluginApplication);
dir.cdUp();
QTranslator translator;
if (translator.load(QLocale::system(), "lrc", "_", dir.absolutePath()+"/Resources/QtTranslations")) {
app->installTranslator(&translator);
//We need to check if primary language is an English variant (en, en-CA etc...) before installing a translator
NSString* lang = [[NSLocale preferredLanguages] objectAtIndex:0];
if (![lang containsString:@"en"]) {
QTranslator translator;
if (translator.load(QLocale::system(), "lrc", "_", dir.absolutePath()+"/Resources/QtTranslations")) {
app->installTranslator(&translator);
} else {
NSLog(@"Couldn't load qt translator");
}
}
CategorizedHistoryModel::instance()->addCollection<LocalHistoryCollection>(LoadOptions::FORCE_ENABLED);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment