2
0
Эх сурвалжийг харах

added translation temlate and german translation

Malte Veerman 10 жил өмнө
parent
commit
47ac8259c4

+ 21 - 1
CMakeLists.txt

@@ -63,4 +63,24 @@ if(BUILD_GUI)
     message(STATUS "Compile GUI")
     add_subdirectory(fancontrol-gui)
     
-endif(BUILD_GUI)
+endif(BUILD_GUI)
+
+#translations
+FILE(GLOB MO_FILES po/*.mo)
+
+set(catalogname fancontrol-gui)
+
+FOREACH(MO_FILE ${MO_FILES})
+    
+    GET_FILENAME_COMPONENT(_moFileName ${MO_FILE} NAME)
+    STRING(REGEX REPLACE "^${catalogname}_?" "" _langCode ${_moFileName} )
+    STRING(REGEX REPLACE "\\.mo$" "" _langCode ${_langCode} )
+
+    IF( _langCode )
+    
+        INSTALL(FILES ${MO_FILE} DESTINATION ${LOCALE_INSTALL_DIR}/${_langCode}/LC_MESSAGES/ RENAME ${catalogname}.mo)
+        LIST(APPEND GMO_FILES ${_gmoFile})
+    
+    ENDIF( _langCode )
+
+ENDFOREACH(MO_FILE ${MO_FILES})

+ 1 - 20
fancontrol-gui/CMakeLists.txt

@@ -11,23 +11,4 @@ set_property(TARGET fancontrol-gui PROPERTY CXX_STANDARD 11)
 install(TARGETS fancontrol-gui RUNTIME DESTINATION ${BIN_INSTALL_DIR})
 install(FILES other/fancontrol-gui.desktop DESTINATION "${SHARE_INSTALL_PREFIX}/applications")
 install(FILES other/fancontrol-gui.svg DESTINATION "${ICON_INSTALL_DIR}/hicolor/scalable/apps")
-install(FILES qml/fancontrol-gui.qml DESTINATION "${SHARE_INSTALL_PREFIX}/fancontrol-gui/qml")
-
-FILE(GLOB MO_FILES po/*.mo)
-
-set(catalogname fancontrol-gui)
-
-FOREACH(MO_FILE ${MO_FILES})
-    
-    GET_FILENAME_COMPONENT(_moFileName ${MO_FILE} NAME)
-    STRING(REGEX REPLACE "^${catalogname}_?" "" _langCode ${_moFileName} )
-    STRING(REGEX REPLACE "\\.mo$" "" _langCode ${_langCode} )
-
-    IF( _langCode )
-    
-        INSTALL(FILES ${MO_FILE} DESTINATION ${LOCALE_INSTALL_DIR}/${_langCode}/LC_MESSAGES/ RENAME ${catalogname}.mo)
-        LIST(APPEND GMO_FILES ${_gmoFile})
-    
-    ENDIF( _langCode )
-
-ENDFOREACH(MO_FILE ${MO_FILES})
+install(FILES qml/fancontrol-gui.qml DESTINATION "${SHARE_INSTALL_PREFIX}/fancontrol-gui/qml")

+ 16 - 16
fancontrol-gui/qml/fancontrol-gui.qml

@@ -25,28 +25,28 @@ import QtQuick.Layouts 1.1
 
 ApplicationWindow {
     id: window
-    title: qsTr("Fancontrol-GUI")
+    title: i18n("Fancontrol-GUI")
     width: 1024
     height: 768
     visible: true
 
     menuBar: MenuBar {
         Menu {
-            title: qsTr("&File")
+            title: i18n("File")
             MenuItem {
-                text: qsTr("Load configuration file")
+                text: i18n("Load configuration file")
                 onTriggered: openFileDialog.open();
             }
             MenuItem {
-                text: qsTr("Save configuration file")
+                text: i18n("Save configuration file")
                 onTriggered: loader.save();
             }
             MenuItem {
-                text: qsTr("Save configuration file as")
+                text: i18n("Save configuration file as")
                 onTriggered: saveFileDialog.open();
             }
             MenuItem {
-                text: qsTr("Exit")
+                text: i18n("Exit")
                 onTriggered: Qt.quit();
             }
         }
@@ -63,7 +63,7 @@ ApplicationWindow {
                 onClicked: openFileDialog.open();
 
                 ToolTip {
-                    text: "Open config file"
+                    text: i18n("Load configuration file")
                 }
             }
             ToolButton {
@@ -71,7 +71,7 @@ ApplicationWindow {
                 onClicked: loader.save();
 
                 ToolTip {
-                    text: "Save config file"
+                    text: i18n("Save configuration file")
                 }
             }
             ToolButton {
@@ -82,7 +82,7 @@ ApplicationWindow {
                                                  [systemdCom.serviceName + ".service", "replace"])
 
                 ToolTip {
-                    text: activeTimer.serviceActive ? "Restart fancontrol" : "Start fancontrol"
+                    text: activeTimer.serviceActive ? i18n("Restart fancontrol") : i18n("Start fancontrol")
                 }
 
 
@@ -95,7 +95,7 @@ ApplicationWindow {
                                                  [systemdCom.serviceName + ".service", "replace"])
 
                 ToolTip {
-                    text: "Stop fancontrol"
+                    text: i18n("Stop fancontrol")
                 }
             }
             Item {
@@ -121,11 +121,11 @@ ApplicationWindow {
         anchors.fill: parent
 
         Tab {
-            title: "Sensors"
+            title: i18n("Sensors")
             SensorsTab {}
         }
         Tab {
-            title: "PwmFans"
+            title: i18n("PwmFans")
             PwmFansTab {
                 size: sizeSlider.value
                 minTemp: tabView.minTemp
@@ -134,12 +134,12 @@ ApplicationWindow {
             }
         }
         Tab {
-            title: "Configfile"
+            title: i18n("Configfile")
             ConfigfileTab {}
         }
 
         Tab {
-            title: "Settings"
+            title: i18n("Settings")
             SettingsTab {
                 id: settingsTab
                 interval: loader.interval
@@ -186,7 +186,7 @@ ApplicationWindow {
 
     FileDialog {
         id: openFileDialog
-        title: "Please choose a configuration file"
+        title: i18n("Please choose a configuration file")
         folder: "file:///etc"
         selectExisting: true
         selectMultiple: false
@@ -199,7 +199,7 @@ ApplicationWindow {
 
     FileDialog {
         id: saveFileDialog
-        title: "Save configuration file as"
+        title: i18n("Save configuration file as")
         folder: "file:///etc"
         selectExisting: false
         selectMultiple: false

BIN
po/de_DE.mo


+ 124 - 0
po/de_DE.po

@@ -0,0 +1,124 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: fancontrol-gui\n"
+"Report-Msgid-Bugs-To: http://github.com/maldela/fancontrol-gui\n"
+"POT-Creation-Date: 2015-07-07 11:14+0200\n"
+"PO-Revision-Date: 2015-07-07 11:16+0200\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.8.2\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Language: de_DE\n"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:28
+msgid "Fancontrol-GUI"
+msgstr "Fancontrol-GUI"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:35
+msgid "File"
+msgstr "Datei"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:37
+#: fancontrol-gui/qml/fancontrol-gui.qml:66
+msgid "Load configuration file"
+msgstr "Konfigurationsdatei öffnen"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:41
+#: fancontrol-gui/qml/fancontrol-gui.qml:74
+msgid "Save configuration file"
+msgstr "Konfigurationsdatei speichern"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:45
+#: fancontrol-gui/qml/fancontrol-gui.qml:202
+msgid "Save configuration file as"
+msgstr "Konfigurationsdatei speichern unter..."
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:49
+msgid "Exit"
+msgstr "Schließen"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:85
+msgid "Restart fancontrol"
+msgstr "Fancontrol neustarten"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:85
+msgid "Start fancontrol"
+msgstr "Fancontrol starten"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:98
+msgid "Stop fancontrol"
+msgstr "Fancontrol stoppen"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:124
+msgid "Sensors"
+msgstr "Sensoren"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:128
+msgid "PwmFans"
+msgstr "PwmLüfter"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:137
+msgid "Configfile"
+msgstr "Konfigurationsdatei"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:142
+msgid "Settings"
+msgstr "Einstellungen"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:189
+msgid "Please choose a configuration file"
+msgstr "Konfigurationsdatei auswählen"
+
+#: rc.cpp:1
+msgctxt "NAME OF TRANSLATORS"
+msgid "Your names"
+msgstr "Malte Veerman"
+
+#: rc.cpp:2
+msgctxt "EMAIL OF TRANSLATORS"
+msgid "Your emails"
+msgstr "maldela@halloarsch.de"
+
+#: share/qml/SettingsTab.qml:31 share/qml/SettingsTab.qml:131
+msgid "Celsius"
+msgstr "Celsius"
+
+#: share/qml/SettingsTab.qml:64
+msgid "Interval:"
+msgstr "Intervall:"
+
+#: share/qml/SettingsTab.qml:84
+msgid "Minimum temperature for fan graphs:"
+msgstr "Minimale Temperatur für Lüftergraphen:"
+
+#: share/qml/SettingsTab.qml:104
+msgid "Maximum temperature for fan graphs:"
+msgstr "Maximale Temperatur für Lüftergraphen:"
+
+#: share/qml/SettingsTab.qml:125
+msgid "Unit:"
+msgstr "Einheit:"
+
+#: share/qml/SettingsTab.qml:131
+msgid "Kelvin"
+msgstr "Kelvin"
+
+#: share/qml/SettingsTab.qml:131
+msgid "Fahrenheit"
+msgstr "Fahrenheit"
+
+#: share/qml/SettingsTab.qml:149
+msgid "Name of the fancontrol systemd service:"
+msgstr "Name des fancontrol systemd services:"
+
+#: share/qml/SettingsTab.qml:170
+msgid "Fancontrol systemd service autostart:"
+msgstr "Fancontrol systemd service Autostart:"

+ 123 - 0
po/fancontrol-gui.pot

@@ -0,0 +1,123 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: http://github.com/maldela/fancontrol-gui\n"
+"POT-Creation-Date: 2015-07-07 11:06+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:28
+msgid "Fancontrol-GUI"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:35
+msgid "File"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:37
+#: fancontrol-gui/qml/fancontrol-gui.qml:66
+msgid "Load configuration file"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:41
+#: fancontrol-gui/qml/fancontrol-gui.qml:74
+msgid "Save configuration file"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:45
+#: fancontrol-gui/qml/fancontrol-gui.qml:202
+msgid "Save configuration file as"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:49
+msgid "Exit"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:85
+msgid "Restart fancontrol"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:85
+msgid "Start fancontrol"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:98
+msgid "Stop fancontrol"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:124
+msgid "Sensors"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:128
+msgid "PwmFans"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:137
+msgid "Configfile"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:142
+msgid "Settings"
+msgstr ""
+
+#: fancontrol-gui/qml/fancontrol-gui.qml:189
+msgid "Please choose a configuration file"
+msgstr ""
+
+#: rc.cpp:1 rc.cpp:1
+msgctxt "NAME OF TRANSLATORS"
+msgid "Your names"
+msgstr ""
+
+#: rc.cpp:2 rc.cpp:2
+msgctxt "EMAIL OF TRANSLATORS"
+msgid "Your emails"
+msgstr ""
+
+#: share/qml/SettingsTab.qml:31 share/qml/SettingsTab.qml:131
+msgid "Celsius"
+msgstr ""
+
+#: share/qml/SettingsTab.qml:64
+msgid "Interval:"
+msgstr ""
+
+#: share/qml/SettingsTab.qml:84
+msgid "Minimum temperature for fan graphs:"
+msgstr ""
+
+#: share/qml/SettingsTab.qml:104
+msgid "Maximum temperature for fan graphs:"
+msgstr ""
+
+#: share/qml/SettingsTab.qml:125
+msgid "Unit:"
+msgstr ""
+
+#: share/qml/SettingsTab.qml:131
+msgid "Kelvin"
+msgstr ""
+
+#: share/qml/SettingsTab.qml:131
+msgid "Fahrenheit"
+msgstr ""
+
+#: share/qml/SettingsTab.qml:149
+msgid "Name of the fancontrol systemd service:"
+msgstr ""
+
+#: share/qml/SettingsTab.qml:170
+msgid "Fancontrol systemd service autostart:"
+msgstr ""

+ 1 - 1
share/CMakeLists.txt

@@ -40,4 +40,4 @@ install(DIRECTORY qml DESTINATION "${SHARE_INSTALL_PREFIX}/fancontrol-gui")
 install(DIRECTORY javascript DESTINATION "${SHARE_INSTALL_PREFIX}/fancontrol-gui")
 install(FILES ${LIB_HEADER} DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/fancontrol-gui/include")
 install(TARGETS fancontrol-gui-share DESTINATION ${CMAKE_INSTALL_PREFIX}/lib EXPORT libfancontrol-gui-share-targets)
-install(EXPORT libfancontrol-gui-share-targets DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/fancontrol-gui")
+install(EXPORT libfancontrol-gui-share-targets DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/fancontrol-gui")

+ 8 - 8
share/qml/SettingsTab.qml

@@ -28,7 +28,7 @@ Item {
     property real maxTemp: 90.0
     property int interval: 1
     property int padding: 10
-    property string unit: "Celsius"
+    property string unit: i18n("Celsius")
 
     id: root
     anchors.fill: parent
@@ -61,7 +61,7 @@ Item {
                     anchors.leftMargin: padding
                     Layout.maximumWidth: parent.width - intervalValue.width - padding*2
                     clip: true
-                    text: "Interval:"
+                    text: i18n("Interval:")
                 }
                 OptionInput {
                     id: intervalValue
@@ -81,7 +81,7 @@ Item {
                     anchors.leftMargin: padding
                     Layout.maximumWidth: parent.width - minTempValue.width - padding*2
                     clip: true
-                    text: "Minimum temperature for fan graphs:"
+                    text: i18n("Minimum temperature for fan graphs:")
                 }
                 OptionInput {
                     id: minTempValue
@@ -101,7 +101,7 @@ Item {
                     anchors.leftMargin: padding
                     Layout.maximumWidth: parent.width - maxTempValue.width - padding*2
                     clip: true
-                    text: "Maximum temperature for fan graphs:"
+                    text: i18n("Maximum temperature for fan graphs:")
                 }
                 OptionInput {
                     id: maxTempValue
@@ -122,13 +122,13 @@ Item {
                     anchors.leftMargin: padding
                     Layout.maximumWidth: parent.width - maxTempValue.width - padding*2
                     clip: true
-                    text: "Unit:"
+                    text: i18n("Unit:")
                 }
                 ComboBox {
                     id: unitBox
                     anchors.right: parent.right
                     anchors.rightMargin: padding
-                    model: ["Celsius", "Kelvin", "Fahrenheit"]
+                    model: [i18n("Celsius"), i18n("Kelvin"), i18n("Fahrenheit")]
                     currentIndex: find(root.unit)
                     onCurrentIndexChanged: {
                         unit = currentText;
@@ -146,7 +146,7 @@ Item {
                     anchors.leftMargin: padding
                     Layout.maximumWidth: parent.width - maxTempValue.width - padding*2
                     clip: true
-                    text: "Name of the fancontrol systemd service:"
+                    text: i18n("Name of the fancontrol systemd service:")
                 }
                 OptionInput {
                     id: serviceName
@@ -167,7 +167,7 @@ Item {
                     anchors.leftMargin: padding
                     Layout.maximumWidth: parent.width - maxTempValue.width - padding*2
                     clip: true
-                    text: "Fancontrol systemd service autostart:"
+                    text: i18n("Fancontrol systemd service autostart:")
                 }
                 ComboBox {
                     id: autostartBox

+ 1 - 1
share/src/export.h

@@ -7,7 +7,7 @@
 #  define FANCONTROL_GUI_EXPORT Q_DECL_IMPORT
 #endif
 
-#define TRANSLATION_DOMAIN "fancontrol-gui"
+//#define TRANSLATION_DOMAIN "fancontrol-gui"
 
 #endif // EXPORT_H