Skip to content

Commit

Permalink
Merge pull request #374 from jmlich/daemon-translations
Browse files Browse the repository at this point in the history
Translations for daemon
  • Loading branch information
piggz authored Jun 2, 2024
2 parents 8efe634 + 4758689 commit a185fdc
Show file tree
Hide file tree
Showing 8 changed files with 547 additions and 3 deletions.
27 changes: 27 additions & 0 deletions daemon/daemon.pro
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,30 @@ HEADERS += \
src/bipactivitydetailparser.h \
src/transliterator.h \
src/activitycoordinate.h

TRANSLATIONS += \
translations/harbour-amazfishd-cs.ts

flavor_uuitk {
DEFINES += TRANSLATION_FOLDER=\\\"/opt/click.ubuntu.com/uk.co.piggz.amazfish/current/translations\\\"
translations_files.path = /translations
} else {
DEFINES += TRANSLATION_FOLDER=\\\"$${PREFIX}/share/$${TARGET}/translations\\\"
translations_files.path = $${PREFIX}/share/$${TARGET}/translations
}

qtPrepareTool(LRELEASE, lrelease)
for(tsfile, TRANSLATIONS) {
qmfile = $$shadowed($$tsfile)
qmfile ~= s,.ts$,.qm,
qmdir = $$dirname(qmfile)
!exists($$qmdir) {
mkpath($$qmdir)|error("Aborting.")
}
command = $$LRELEASE -removeidentical $$tsfile -qm $$qmfile
system($$command)|error("Failed to run: $$command")
TRANSLATIONS_FILES += $$qmfile
translations_files.files = $${TRANSLATIONS_FILES}
}

INSTALLS += translations_files
15 changes: 15 additions & 0 deletions daemon/src/harbour-amazfish-daemon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,21 @@ int main(int argc, char **argv)
QCoreApplication::setOrganizationName("harbour-amazfish");
QCoreApplication::setApplicationName("harbour-amazfish");

{
QString tr_path(TRANSLATION_FOLDER);
if ( !tr_path.isEmpty() ) {
QString locale = QLocale::system().name();
QTranslator *translator = new QTranslator();

if ( !translator->load(QLocale(), "harbour-amazfishd", "-", tr_path) ) {
qWarning() << "Failed to load translation for " << locale << " " << tr_path;
}

app.installTranslator(translator);
}

}

daemonize();

setlinebuf(stdout);
Expand Down
187 changes: 187 additions & 0 deletions daemon/translations/harbour-amazfishd-cs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="cs">
<context>
<name>AbstractDevice</name>
<message>
<location filename="../src/devices/abstractdevice.cpp" line="141"/>
<source>Device does not support settings</source>
<translation>Zařízení nepodporuje nastavení</translation>
</message>
</context>
<context>
<name>AsteroidOSDevice</name>
<message>
<location filename="../src/devices/asteroidosdevice.cpp" line="313"/>
<source>Stored %1...</source>
<translation>Uloženo %1 ...</translation>
</message>
</context>
<context>
<name>BipDevice</name>
<message>
<location filename="../src/devices/bipdevice.cpp" line="141"/>
<source>Navigation Started</source>
<translation>Navigace spuštěna</translation>
</message>
<message>
<location filename="../src/devices/bipdevice.cpp" line="143"/>
<source>Navigation Stopped</source>
<translation>Navigace zastavena</translation>
</message>
<message>
<location filename="../src/devices/bipdevice.cpp" line="151"/>
<source>Progress</source>
<translation>Průběh</translation>
</message>
</context>
<context>
<name>BipFirmwareService</name>
<message>
<location filename="../src/services/bipfirmwareservice.cpp" line="38"/>
<source>An operation is currently running, please try later</source>
<translation>Momentálně běží operace. Prosím zkuste to později</translation>
</message>
<message>
<location filename="../src/services/bipfirmwareservice.cpp" line="51"/>
<source>Sending %1...</source>
<translation>Odesílá %1 ...</translation>
</message>
<message>
<location filename="../src/services/bipfirmwareservice.cpp" line="54"/>
<source>No file selected</source>
<translation>Nebyl vybrán soubor</translation>
</message>
</context>
<context>
<name>DeviceInterface</name>
<message>
<location filename="../src/deviceinterface.cpp" line="109"/>
<source>Device is not valid, it may not be supported</source>
<translation>Zařízení není platné, nemusí být podporované</translation>
</message>
<message>
<location filename="../src/deviceinterface.cpp" line="446"/>
<source>Amazfish</source>
<translation>Amazfish</translation>
</message>
<message>
<location filename="../src/deviceinterface.cpp" line="446"/>
<source>Connected</source>
<translation>Připojeno</translation>
</message>
<message>
<location filename="../src/deviceinterface.cpp" line="446"/>
<source>Phone and watch are connected</source>
<translation>Telefon a hodinky jsou propojeny</translation>
</message>
<message>
<location filename="../src/deviceinterface.cpp" line="511"/>
<source>Low Battery</source>
<translation>Slabá baterie</translation>
</message>
<message>
<location filename="../src/deviceinterface.cpp" line="511"/>
<source>Battery level now </source>
<translation>Stupeň nabití </translation>
</message>
</context>
<context>
<name>DfuService</name>
<message>
<location filename="../src/services/dfuservice.cpp" line="35"/>
<source>An operation is currently running, please try later</source>
<translation>Momentálně probíhá operace. Prosím zkuste to později</translation>
</message>
<message>
<location filename="../src/services/dfuservice.cpp" line="49"/>
<source>No file selected</source>
<translation>Nebyl vybrán soubor</translation>
</message>
</context>
<context>
<name>HuamiDevice</name>
<message>
<location filename="../src/devices/huamidevice.cpp" line="172"/>
<source>Navigation Started</source>
<translation>Navigace spuštěna</translation>
</message>
<message>
<location filename="../src/devices/huamidevice.cpp" line="174"/>
<source>Navigation Stopped</source>
<translation>Navigace zastavena</translation>
</message>
<message>
<location filename="../src/devices/huamidevice.cpp" line="181"/>
<source>Progress</source>
<translation>Průbeh</translation>
</message>
</context>
<context>
<name>MiBandService</name>
<message>
<location filename="../src/services/mibandservice.cpp" line="461"/>
<location filename="../src/services/mibandservice.cpp" line="521"/>
<source>Firmware is too old to set display items, V0.1.1.14 is required</source>
<translation>Firmware je příliš starý pro nastavení položek na obrazovku, požadovaný je V0.1.1.14</translation>
</message>
<message>
<location filename="../src/services/mibandservice.cpp" line="646"/>
<location filename="../src/services/mibandservice.cpp" line="668"/>
<location filename="../src/services/mibandservice.cpp" line="681"/>
<source>An operation is currently running, please try later</source>
<translation>Momentálně probíhá operace. Prosím zkuste to později</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../src/operations/abstractfetchoperation.cpp" line="68"/>
<source>About to transfer data from </source>
<translation>Připravuje se na přenos dat z </translation>
</message>
<message>
<location filename="../src/operations/abstractfetchoperation.cpp" line="79"/>
<source>Finished transferring activity data</source>
<translation>Dokončen přenos dat o aktivitě</translation>
</message>
<message>
<location filename="../src/operations/abstractfetchoperation.cpp" line="83"/>
<source>No data to transfer</source>
<translation>Žádné data k přenosu</translation>
</message>
<message>
<location filename="../src/operations/dfuoperation.cpp" line="176"/>
<location filename="../src/operations/dfuoperation.cpp" line="195"/>
<location filename="../src/operations/huamiupdatefirmwareoperation2020.cpp" line="84"/>
<location filename="../src/operations/updatefirmwareoperation.cpp" line="77"/>
<source>Update operation failed</source>
<translation>Operace aktualizace selhala</translation>
</message>
<message>
<location filename="../src/operations/dfuoperation.cpp" line="214"/>
<location filename="../src/operations/huamiupdatefirmwareoperation2020.cpp" line="96"/>
<location filename="../src/operations/updatefirmwareoperation.cpp" line="85"/>
<source>Update operation failed, unexpected metadata</source>
<translation>Operace aktualizace selhala, neočekávané metadata</translation>
</message>
<message>
<location filename="../src/operations/huamiupdatefirmwareoperation2020.cpp" line="71"/>
<location filename="../src/operations/huamiupdatefirmwareoperation2020.cpp" line="78"/>
<location filename="../src/operations/updatefirmwareoperation.cpp" line="64"/>
<source>Update operation complete</source>
<translation>Operace aktualizace dokončena</translation>
</message>
<message>
<location filename="../src/operations/huamiupdatefirmwareoperation2020.cpp" line="94"/>
<source>Update operation failed, filetype not supported</source>
<translation>Operace aktualizace selhala, typ souboru není podporovaný</translation>
</message>
<message>
<location filename="../src/operations/huamiupdatefirmwareoperation2020.cpp" line="108"/>
<location filename="../src/operations/updatefirmwareoperation.cpp" line="28"/>
<source>File does not seem to be supported</source>
<translation>Zdá se. že typ souboru není podporovaný</translation>
</message>
</context>
</TS>
147 changes: 147 additions & 0 deletions daemon/translations/harbour-amazfishd-pl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="pl">
<context>
<name>AbstractDevice</name>
<message>
<source>Device does not support settings</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AsteroidOSDevice</name>
<message>
<source>Stored %1...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BipDevice</name>
<message>
<source>Navigation Started</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Navigation Stopped</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Progress</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>BipFirmwareService</name>
<message>
<source>An operation is currently running, please try later</source>
<translation>Operacja jest aktualnie uruchomiona, spróbuj później</translation>
</message>
<message>
<source>No file selected</source>
<translation>Brak wybranego pliku</translation>
</message>
<message>
<source>Sending %1...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DeviceInterface</name>
<message>
<source>Device is not valid, it may not be supported</source>
<translation>Urządzenie jest nieprawidłowe, może nie być obsługiwane</translation>
</message>
<message>
<source>Amazfish</source>
<translation type="unfinished">Amazfish</translation>
</message>
<message>
<source>Connected</source>
<translation type="unfinished">Połączony</translation>
</message>
<message>
<source>Phone and watch are connected</source>
<translation type="unfinished">Telefon i zegarek są połączone</translation>
</message>
<message>
<source>Low Battery</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Battery level now </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DfuService</name>
<message>
<source>An operation is currently running, please try later</source>
<translation type="unfinished">Operacja jest aktualnie uruchomiona, spróbuj później</translation>
</message>
<message>
<source>No file selected</source>
<translation type="unfinished">Brak wybranego pliku</translation>
</message>
</context>
<context>
<name>HuamiDevice</name>
<message>
<source>Navigation Started</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Navigation Stopped</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Progress</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MiBandService</name>
<message>
<source>An operation is currently running, please try later</source>
<translation>Operacja jest aktualnie uruchomiona, spróbuj później</translation>
</message>
<message>
<source>Firmware is too old to set display items, V0.1.1.14 is required</source>
<translation>Oprogramowanie układowe jest za stare, aby ustawić elementy wyświetlania, wymagany jest V0.1.1.14</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<source>Finished transferring activity data</source>
<translation>Zakończono przesyłanie danych o aktywności</translation>
</message>
<message>
<source>No data to transfer</source>
<translation>Brak danych do przesłania</translation>
</message>
<message>
<source>Update operation failed</source>
<translation>Operacja aktualizacji nie powiodła się</translation>
</message>
<message>
<source>Update operation failed, unexpected metadata</source>
<translation>Operacja aktualizacji nie powiodła się, nieoczekiwane metadane</translation>
</message>
<message>
<source>Update operation complete</source>
<translation>Operacja aktualizacji zakończona</translation>
</message>
<message>
<source>File does not seem to be supported</source>
<translation>Plik wydaje się być nieobsługiwany</translation>
</message>
<message>
<source>About to transfer data from </source>
<translation>O przesyłaniu danych z </translation>
</message>
<message>
<source>Update operation failed, filetype not supported</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Loading

0 comments on commit a185fdc

Please sign in to comment.