Commit 0f59fa0a authored by Andreas Traczyk's avatar Andreas Traczyk

translations: fix paths for native build

Change-Id: Iaa7c1a5021736123b66aef727053a3feb105437f
parent 4a04866c
......@@ -143,7 +143,7 @@ Get-ChildItem -Path $clientTSPath -Include *.ts -Recurse | ForEach-Object {
$CopyDir = $OutDir + "\share\ring\translations"
New-Item -ItemType directory -Path $CopyDir -Force
write-host "copying ringtones..."
Get-ChildItem -Path $lrcTSPath -Include *.qm -Recurse | ForEach-Object {
Get-ChildItem -Path $clientTSPath -Include *.qm -Recurse | ForEach-Object {
write-host "copying translation file: " $_.FullName " => " $CopyDir
Copy-Item -Path $_.FullName -Destination $CopyDir -Force Recurse
}
......
......@@ -188,14 +188,15 @@ main(int argc, char *argv[])
ShmClient* shmClient = new ShmClient(shm, sem);
#endif
auto appDir = qApp->applicationDirPath() + "/";
const auto locale_name = QLocale::system().name();
const auto locale_lang = locale_name.split('_')[0];
QTranslator qtTranslator_lang;
QTranslator qtTranslator_name;
if (locale_name != locale_lang) {
qtTranslator_lang.load("qt_" + locale_lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
a.installTranslator(&qtTranslator_lang);
if (qtTranslator_lang.load("qt_" + locale_lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
a.installTranslator(&qtTranslator_lang);
}
qtTranslator_name.load("qt_" + locale_name, QLibraryInfo::location(QLibraryInfo::TranslationsPath));
a.installTranslator(&qtTranslator_name);
......@@ -203,20 +204,20 @@ main(int argc, char *argv[])
QTranslator lrcTranslator_lang;
QTranslator lrcTranslator_name;
if (locale_name != locale_lang) {
lrcTranslator_lang.load("share/libringclient/translations/lrc_" + locale_lang);
a.installTranslator(&lrcTranslator_lang);
if (lrcTranslator_lang.load(appDir + "share/libringclient/translations/lrc_" + locale_lang))
a.installTranslator(&lrcTranslator_lang);
}
lrcTranslator_name.load("share/libringclient/translations/lrc_" + locale_name);
a.installTranslator(&lrcTranslator_name);
if (lrcTranslator_name.load(appDir + "share/libringclient/translations/lrc_" + locale_name))
a.installTranslator(&lrcTranslator_name);
QTranslator mainTranslator_lang;
QTranslator mainTranslator_name;
if (locale_name != locale_lang) {
mainTranslator_lang.load("share/ring/translations/ring_client_windows_" + locale_lang);
a.installTranslator(&mainTranslator_lang);
if (mainTranslator_lang.load(appDir + "share/ring/translations/ring_client_windows_" + locale_lang))
a.installTranslator(&mainTranslator_lang);
}
mainTranslator_name.load("share/ring/translations/ring_client_windows_" + locale_name);
a.installTranslator(&mainTranslator_name);
if (mainTranslator_name.load(appDir + "share/ring/translations/ring_client_windows_" + locale_name))
a.installTranslator(&mainTranslator_name);
QFont font;
font.setFamily("Segoe UI");
......@@ -245,7 +246,6 @@ main(int argc, char *argv[])
MainWindow::instance().hide();
}
#ifdef URI_PROTOCOL
QObject::connect(shmClient, SIGNAL(RingEvent(QString)), &MainWindow::instance(), SLOT(onRingEvent(QString)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment