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

translations: fix paths for native build

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