Skip to content

Commit

Permalink
Translations: Use the standard way
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien Proriol committed Jul 22, 2015
1 parent 04a2fb5 commit 1df6572
Show file tree
Hide file tree
Showing 15 changed files with 1,027 additions and 40 deletions.
3 changes: 2 additions & 1 deletion CarBudget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ int main(int argc, char *argv[])
QQuickView *view = SailfishApp::createView();

QTranslator translator;
if(translator.load((QLocale::system().name() != "C")?(QLocale::system().name()):("en_GB"), ":/i18n"))
if(translator.load((QLocale::system().name() != "C")?(QLocale::system().name()):("en_GB"), "/usr/share/harbour-carbudget/translations/"))
{
QGuiApplication::installTranslator(&translator);
}

app->setApplicationVersion(QString(APP_VERSION));

qmlRegisterType<Tank>( "harbour.carbudget",1,0,"Tank");
Expand Down
6 changes: 0 additions & 6 deletions Ressources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,4 @@
<file alias="Wrench.png">picture/Wrench.png</file>
<file alias="Dollar.png">picture/Dollar.png</file>
</qresource>
<qresource prefix="/i18n">
<file alias="fr_FR.qm">i18n/fr_FR.qm</file>
<file alias="it_IT.qm">i18n/it_IT.qm</file>
<file alias="de_DE.qm">i18n/de_DE.qm</file>
<file alias="ru_RU.qm">i18n/ru_RU.qm</file>
</qresource>
</RCC>
16 changes: 9 additions & 7 deletions harbour-carbudget.pro
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ lupdate_only{
}


CONFIG += sailfishapp_i18n

TRANSLATIONS = translations/de_DE.ts \
translations/fr_FR.ts \
translations/it_IT.ts \
translations/ru_RU.ts \
translations/sv_SE.ts


DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\"

OTHER_FILES += qml/cover/CoverPage.qml \
Expand All @@ -53,13 +62,10 @@ OTHER_FILES += qml/cover/CoverPage.qml \
qml/pages/TireMount.qml \
qml/pages/About.qml \
qml/pages/CarCreate.qml \
i18n/FR_fr.ts \
i18n/RU_ru.ts \
qml/pages/BudgetView.qml \
qml/pages/Settings.qml \
qml/pages/CosttypeEntry.qml \
qml/pages/CosttypeView.qml \
i18n/de_DE.ts \
qml/pages/SelectImportFile.qml \
qml/pages/MycarImport.qml \
qml/pages/FuelpadImport.qml \
Expand All @@ -84,10 +90,6 @@ HEADERS += \
statfileinfo.h \
globals.h

TRANSLATIONS = i18n/de_DE.ts \
i18n/fr_FR.ts \
i18n/it_IT.ts \
i18n/ru_RU.ts

RESOURCES += \
Ressources.qrc
Binary file removed i18n/de_DE.qm
Binary file not shown.
Binary file removed i18n/fr_FR.qm
Binary file not shown.
Binary file removed i18n/it_IT.qm
Binary file not shown.
Binary file removed i18n/ru_RU.qm
Binary file not shown.
3 changes: 2 additions & 1 deletion rpm/CarBudget.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: harbour-carbudget
Summary: Car expenses calculation
Version: 0.12
Version: 0.13
Release: 0
Group: Qt/Qt
License: GPL
Expand All @@ -22,6 +22,7 @@ Requires:
Files:
- '%{_bindir}'
- '%{_datadir}/%{name}/qml'
- '%{_datadir}/%{name}/translations'
- '%{_datadir}/applications/%{name}.desktop'
- '%{_datadir}/icons/hicolor/86x86/apps/%{name}.png'
- '%{_datadir}/applications'
Expand Down
13 changes: 9 additions & 4 deletions i18n/de_DE.ts → translations/de_DE.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="de_DE">
<TS version="2.1" language="de_DE">
<context>
<name>About</name>
<message>
<location filename="../qml/pages/About.qml" line="61"/>
<location filename="../qml/pages/About.qml" line="39"/>
<source>Simulation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="63"/>
<source>License: GPLv3</source>
<translation>Lizenz: GPLv3</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="66"/>
<location filename="../qml/pages/About.qml" line="68"/>
<source>Created by condo4 (Fabien Proriol)</source>
<translation>Erstellt von condo4 (Fabien Proriol) </translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="72"/>
<location filename="../qml/pages/About.qml" line="74"/>
<source>Credits to:&lt;br&gt;- Lorenzo Facca (Italian translation)&lt;br&gt;- Alois Spitzbart (German translation)&lt;br&gt;- Michal Hrusecky (Many improvments)&lt;br&gt;- Denis Fedoseev (Russion translation)&lt;br &gt;- Thomas Michel (Many improvments)</source>
<translation>Dank an:&lt;br&gt;- Lorenzo Facca (Italienisch Übersetzung)&lt;br&gt;- Alois Spitzbart (Deutsche Übersetzung)&lt;br&gt;- Michal Hrusecky (Viele Verbesserungen)&lt;br&gt;- Denis Fedoseev (Russische Übersetzung)&lt;br &gt;- Thomas Michel (Viele Verbesserungen)</translation>
</message>
Expand Down
11 changes: 6 additions & 5 deletions i18n/fr_FR.ts → translations/fr_FR.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fr_FR">
<TS version="2.1" language="fr_FR">
<context>
<name>About</name>
<message>
<location filename="../qml/pages/About.qml" line="39"/>
<source>Simulation</source>
<translation type="obsolete">Simulation</translation>
<translation type="unfinished">Simulation</translation>
</message>
<message>
<source>Distance: %L1 km</source>
<translation type="obsolete">Distance: %L1 km</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="61"/>
<location filename="../qml/pages/About.qml" line="63"/>
<source>License: GPLv3</source>
<translation>Licence : GPLv3</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="66"/>
<location filename="../qml/pages/About.qml" line="68"/>
<source>Created by condo4 (Fabien Proriol)</source>
<translation>Créé par condo4 (Fabien Proriol)</translation>
</message>
<message>
<location filename="../qml/pages/About.qml" line="72"/>
<location filename="../qml/pages/About.qml" line="74"/>
<source>Credits to:&lt;br&gt;- Lorenzo Facca (Italian translation)&lt;br&gt;- Alois Spitzbart (German translation)&lt;br&gt;- Michal Hrusecky (Many improvments)&lt;br&gt;- Denis Fedoseev (Russion translation)&lt;br &gt;- Thomas Michel (Many improvments)</source>
<translation>Remerciments :&lt;br&gt;- Lorenzo Facca (Italien)&lt;br&gt;- Alois Spitzbart (Allemand)&lt;br&gt;- Denis Fedoseev (Russe)&lt;br&gt;- Michal Hrusecky (divers améliorations)&lt;br &gt;- Thomas Michel (divers améliorations)</translation>
</message>
Expand Down
Loading

0 comments on commit 1df6572

Please sign in to comment.