added internationalization
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Tue, 24 Jan 2012 23:26:51 +0100
changeset 17 1b8e420714ff
parent 16 79b98c86c170
child 18 10f60cdb6cc4
added internationalization
i18n/igc.de_DE.ts
igc.de_DE.ts
igc.pro
main.cc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/i18n/igc.de_DE.ts	Tue Jan 24 23:26:51 2012 +0100
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="de_DE">
+<context>
+    <name>MainWindow</name>
+    <message>
+        <location filename="../ui/mainwindow.ui" line="14"/>
+        <source>MainWindow</source>
+        <translation>IGC Betrachter</translation>
+    </message>
+    <message>
+        <location filename="../ui/mainwindow.ui" line="25"/>
+        <source>Info</source>
+        <translation>Info</translation>
+    </message>
+    <message>
+        <location filename="../ui/mainwindow.ui" line="59"/>
+        <source>Attribute</source>
+        <translation>Feld</translation>
+    </message>
+    <message>
+        <location filename="../ui/mainwindow.ui" line="70"/>
+        <source>Value</source>
+        <translation>Wert</translation>
+    </message>
+    <message>
+        <location filename="../ui/mainwindow.ui" line="85"/>
+        <source>Altitude</source>
+        <translation>Höhenprofil</translation>
+    </message>
+    <message>
+        <location filename="../ui/mainwindow.ui" line="108"/>
+        <source>&amp;File</source>
+        <translation>&amp;Datei</translation>
+    </message>
+    <message>
+        <location filename="../ui/mainwindow.ui" line="116"/>
+        <source>&amp;Help</source>
+        <translation>&amp;Hilfe</translation>
+    </message>
+    <message>
+        <location filename="../ui/mainwindow.ui" line="126"/>
+        <source>E&amp;xit</source>
+        <translation>&amp;Ende</translation>
+    </message>
+    <message>
+        <location filename="../ui/mainwindow.ui" line="131"/>
+        <source>&amp;Open</source>
+        <translation>&amp;Öffnen</translation>
+    </message>
+    <message>
+        <location filename="../ui/mainwindow.ui" line="136"/>
+        <source>About Qt</source>
+        <translation>Über Qt</translation>
+    </message>
+    <message>
+        <location filename="../mainwindow.cc" line="29"/>
+        <source>Open IGC file</source>
+        <translation>IGC Datei Öffnen</translation>
+    </message>
+    <message>
+        <location filename="../mainwindow.cc" line="30"/>
+        <source>IGC files (*.igc);; All files (*)</source>
+        <translation>IGC Dateien (*.igc);; Alle Dateien (*)</translation>
+    </message>
+    <message>
+        <location filename="../mainwindow.cc" line="43"/>
+        <source>Ooops!</source>
+        <translation>Ooops!</translation>
+    </message>
+    <message>
+        <location filename="../mainwindow.cc" line="44"/>
+        <source>The file %1 cannot be opened: %2!</source>
+        <translation>Die Datei %1 kann nicht geöffnet werden: %2!</translation>
+    </message>
+    <message>
+        <location filename="../mainwindow.cc" line="50"/>
+        <source>opening %1</source>
+        <translation>Öffnen von %1...</translation>
+    </message>
+    <message>
+        <location filename="../mainwindow.cc" line="67"/>
+        <source>Pilot</source>
+        <translation>Pilot</translation>
+    </message>
+    <message>
+        <location filename="../mainwindow.cc" line="72"/>
+        <source>Date</source>
+        <translation>Datum</translation>
+    </message>
+    <message>
+        <location filename="../mainwindow.cc" line="79"/>
+        <source>Glider</source>
+        <translation>Schirmtyp</translation>
+    </message>
+</context>
+</TS>
--- a/igc.de_DE.ts	Tue Jan 24 01:56:45 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="de_DE">
-<context>
-    <name>MainWindow</name>
-    <message>
-        <location filename="ui/mainwindow.ui" line="14"/>
-        <source>MainWindow</source>
-        <translation>IGC</translation>
-    </message>
-    <message>
-        <location filename="ui/mainwindow.ui" line="25"/>
-        <source>Info</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="ui/mainwindow.ui" line="59"/>
-        <source>Attribute</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="ui/mainwindow.ui" line="70"/>
-        <source>Value</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="ui/mainwindow.ui" line="85"/>
-        <source>Altitude</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="ui/mainwindow.ui" line="108"/>
-        <source>&amp;File</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="ui/mainwindow.ui" line="116"/>
-        <source>&amp;Help</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="ui/mainwindow.ui" line="126"/>
-        <source>E&amp;xit</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="ui/mainwindow.ui" line="131"/>
-        <source>&amp;Open</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="ui/mainwindow.ui" line="136"/>
-        <source>About Qt</source>
-        <translation>Über Qt</translation>
-    </message>
-    <message>
-        <location filename="mainwindow.cc" line="29"/>
-        <source>Open IGC file</source>
-        <translation>IGC Datei Öffnen</translation>
-    </message>
-    <message>
-        <location filename="mainwindow.cc" line="30"/>
-        <source>IGC files (*.igc);; All files (*)</source>
-        <translation>IGC Dateien (*.igc);; Alle Dateien (*)</translation>
-    </message>
-    <message>
-        <location filename="mainwindow.cc" line="43"/>
-        <source>Ooops!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="mainwindow.cc" line="44"/>
-        <source>The file %1 cannot be opened: %2!</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="mainwindow.cc" line="50"/>
-        <source>opening %1</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="mainwindow.cc" line="67"/>
-        <source>Pilot</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="mainwindow.cc" line="72"/>
-        <source>Date</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="mainwindow.cc" line="79"/>
-        <source>Glider</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-</TS>
--- a/igc.pro	Tue Jan 24 01:56:45 2012 +0100
+++ b/igc.pro	Tue Jan 24 23:26:51 2012 +0100
@@ -13,7 +13,7 @@
 OBJECTS_DIR = .build/
 MOC_DIR = .build/
 
-TRANSLATIONS = igc.de_DE.ts
+TRANSLATIONS = i18n/igc.de_DE.ts
 
 # Input
 PRECOMPILED_HEADER += pch.h
--- a/main.cc	Tue Jan 24 01:56:45 2012 +0100
+++ b/main.cc	Tue Jan 24 23:26:51 2012 +0100
@@ -7,7 +7,8 @@
     QApplication app(argc, argv);
 
     QTranslator  translator;
-    translator.load("igc");
+    qDebug() << QLocale::system().name();
+    translator.load("igc." + QLocale::system().name(), "i18n");
     app.installTranslator(&translator);
 
     MainWindow mw;