summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShrikant Dhumal <shrikant.dhumal@theqtcompany.com>2016-09-30 11:58:26 -0700
committerAlistair Adams <alistair.adams@qt.io>2016-10-03 03:50:47 +0000
commitd9811525821aae5a034d0a5157cca0120f3843a2 (patch)
treec8be794f0170ada1c6c34e5ceb9102856404c2e4
parent28058cd57e6223b157e2318dae04ee37f5ec2d42 (diff)
downloadneptune-ui-d9811525821aae5a034d0a5157cca0120f3843a2.tar.gz
Created internationalization and localization app
Change-Id: If3bee4300b7188c8bb1fd566af8efef68c56229b Reviewed-by: Alistair Adams <alistair.adams@qt.io>
-rw-r--r--apps/com.theqtcompany.i18ndemo/I18NDemo.qml67
-rw-r--r--apps/com.theqtcompany.i18ndemo/Languages.qml278
-rw-r--r--apps/com.theqtcompany.i18ndemo/README12
-rw-r--r--apps/com.theqtcompany.i18ndemo/icon.pngbin0 -> 8845 bytes
-rw-r--r--apps/com.theqtcompany.i18ndemo/info.yaml14
-rw-r--r--apps/com.theqtcompany.i18ndemo/qt-icon.pngbin0 -> 2759 bytes
-rwxr-xr-xapps/com.theqtcompany.i18ndemo/translations/create_qm.sh95
-rwxr-xr-xapps/com.theqtcompany.i18ndemo/translations/create_ts.sh98
-rw-r--r--apps/com.theqtcompany.i18ndemo/translations/i18napp_ar_AR.ts52
-rw-r--r--apps/com.theqtcompany.i18ndemo/translations/i18napp_de_DE.ts52
-rw-r--r--apps/com.theqtcompany.i18ndemo/translations/i18napp_en_GB.ts52
-rw-r--r--apps/com.theqtcompany.i18ndemo/translations/i18napp_fi_FI.ts52
-rw-r--r--apps/com.theqtcompany.i18ndemo/translations/i18napp_fr_FR.ts52
-rw-r--r--apps/com.theqtcompany.i18ndemo/translations/i18napp_ja_JP.ts52
-rw-r--r--apps/com.theqtcompany.i18ndemo/translations/i18napp_ko_KR.ts52
-rw-r--r--apps/com.theqtcompany.i18ndemo/translations/i18napp_ru_RU.ts52
-rw-r--r--apps/com.theqtcompany.i18ndemo/translations/i18napp_zh_CN.ts52
-rw-r--r--apps/com.theqtcompany.i18ndemo/translations/i18napp_zh_TW.ts52
-rw-r--r--neptuneui.pro3
-rw-r--r--plugins/comtqci18ndemo/comtqci18ndemo.cpp99
-rw-r--r--plugins/comtqci18ndemo/comtqci18ndemo.h72
-rw-r--r--plugins/comtqci18ndemo/comtqci18ndemo.pro30
-rw-r--r--plugins/comtqci18ndemo/plugin.cpp49
-rw-r--r--plugins/comtqci18ndemo/qmldir2
24 files changed, 1338 insertions, 1 deletions
diff --git a/apps/com.theqtcompany.i18ndemo/I18NDemo.qml b/apps/com.theqtcompany.i18ndemo/I18NDemo.qml
new file mode 100644
index 0000000..977bee3
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/I18NDemo.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Neptune IVI UI.
+**
+** $QT_BEGIN_LICENSE:GPL-QTAS$
+** Commercial License Usage
+** Licensees holding valid commercial Qt Automotive Suite licenses may use
+** this file in accordance with the commercial license agreement provided
+** with the Software or, alternatively, in accordance with the terms
+** contained in a written agreement between you and The Qt Company. For
+** licensing terms and conditions see https://www.qt.io/terms-conditions.
+** For further information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+** SPDX-License-Identifier: GPL-3.0
+**
+****************************************************************************/
+
+import QtQuick 2.5
+
+import controls 1.0
+import utils 1.0
+
+import com.theqtcompany.comtqci18ndemo 1.0
+
+AppUIScreen {
+ id: root
+
+ UIScreen {
+
+ ComTQCi18nDemo {
+ id: ctd
+ onLanguageLocaleChanged: {
+ console.log("Locale changed " + languageLocale)
+ }
+ }
+
+ TabView {
+ id: tabView
+ anchors.fill: parent
+ tabs: [
+ //% "Internationalization and Localization"
+ { title : qsTrId("page_title_id") + ctd.emptyString, url : Qt.resolvedUrl("Languages.qml"), properties : {} },
+ ]
+ }
+
+ onBackScreen: root.back()
+
+ Component.onCompleted: {
+ ctd.setPrefix("i18napp");
+ ctd.setPath(Qt.resolvedUrl("./translations/"));
+ }
+ }
+}
diff --git a/apps/com.theqtcompany.i18ndemo/Languages.qml b/apps/com.theqtcompany.i18ndemo/Languages.qml
new file mode 100644
index 0000000..86367af
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/Languages.qml
@@ -0,0 +1,278 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Neptune IVI UI.
+**
+** $QT_BEGIN_LICENSE:GPL-QTAS$
+** Commercial License Usage
+** Licensees holding valid commercial Qt Automotive Suite licenses may use
+** this file in accordance with the commercial license agreement provided
+** with the Software or, alternatively, in accordance with the terms
+** contained in a written agreement between you and The Qt Company. For
+** licensing terms and conditions see https://www.qt.io/terms-conditions.
+** For further information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+** SPDX-License-Identifier: GPL-3.0
+**
+****************************************************************************/
+
+import QtQuick 2.5
+import QtQuick.Controls 2.0
+import QtQuick.Layouts 1.3
+
+import com.theqtcompany.comtqci18ndemo 1.0
+
+import controls 1.0
+import utils 1.0
+
+UIPage {
+ id: root
+
+ RowLayout {
+ id: panes
+
+ spacing: Style.hspan(1)
+
+ anchors.fill: parent
+
+ ColumnLayout {
+ id: langSelectionLayout
+
+ spacing: Style.vspan(1)
+
+ anchors.top: parent.top
+ anchors.topMargin: Style.vspan(3)
+ anchors.left: parent.left
+ anchors.leftMargin: Style.hspan(1)
+
+ QtObject {
+ id: langListBuilder
+ property var list: VirtualKeyboardSettings.activeLocales
+ //property var list: new Array("ar_AR", "de_DE", "en_GB", "fr_FR", "fi_FI", "ko_KR", "ja_JP", "zh_CN", "zh_TW", "ru_RU")
+
+ onListChanged: {
+ var idx = 0
+ var idx_ofenGB = 0
+ var localeObj
+
+ if (list.length > 0) {
+ for (idx = 0;idx < list.length;idx++) {
+ if (list[idx] === "en_GB") {
+ idx_ofenGB = idx
+ }
+
+ localeObj = Qt.locale(list[idx])
+
+ langList.append( {
+ language: list[idx],
+ languageName: localeObj.nativeLanguageName,
+ rtl: (localeObj.textDirection === Qt.RightToLeft)
+ } )
+ }
+ }
+ langSelectView.currentIndex = idx_ofenGB-1
+ }
+ }
+
+ ListModel {
+ id: langList
+ }
+
+ Label {
+ id: lblHeader
+ //% "Language Selection"
+ text: qsTrId("lang_selection_id") + ctd.emptyString
+ hspan: 5
+ vspan: 1
+ font.pixelSize: Style.fontSizeM
+ LayoutMirroring.enabled: (Qt.locale(ctd.languageLocale).textDirection === Qt.RightToLeft)
+ }
+
+ ListViewManager {
+ id: langSelectView
+
+ width: Style.hspan(5)
+ height: Style.vspan(6)
+
+ model: langList
+
+ delegate: CategoryListItem {
+ width: ListView.view.width
+ height: Style.vspan(1)
+
+ text: model.languageName
+
+ onClicked: langSelectView.currentIndex = index
+ }
+ onCurrentIndexChanged: {
+ console.log("Index changed " + currentIndex)
+ ctd.languageLocale = langList.get(currentIndex)?langList.get(currentIndex).language:""
+ VirtualKeyboardSettings.locale = ctd.languageLocale
+ }
+ }
+ Component.onCompleted: {
+ VirtualKeyboardSettings.activeLocales = new Array("ar_AR", "de_DE", "en_GB", "fr_FR", "fi_FI", "ko_KR", "ja_JP", "zh_CN", "zh_TW", "ru_RU")
+ }
+ }
+
+ Flickable {
+ anchors.top: parent.top
+
+ anchors.left: langSelectionLayout.right
+ anchors.leftMargin: Style.hspan(1)
+
+ ColumnLayout {
+ id: elementContainer
+
+ anchors.top: parent.top
+ anchors.verticalCenter: parent.verticalCenter
+
+ spacing: Style.vspan(1)
+
+ LayoutMirroring.enabled: (Qt.locale(ctd.languageLocale).textDirection === Qt.RightToLeft)
+ LayoutMirroring.childrenInherit: true
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Label {
+ hspan: 4
+ //% "Number"
+ text: qsTrId("number_id") + ctd.emptyString
+ font.pixelSize: Style.fontSizeL
+ }
+
+ Label {
+ hspan: 6
+
+ text: Number(10.5456).toLocaleString(Qt.locale(ctd.languageLocale), 'f', 4)
+ font.pixelSize: Style.fontSizeL
+ }
+
+ }
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Label {
+ hspan: 4
+ //% "Currency"
+ text: qsTrId("currency_id") + ctd.emptyString
+ font.pixelSize: Style.fontSizeL
+ }
+
+ Label {
+ hspan: 6
+
+ text: Number(2900.40).toLocaleCurrencyString(Qt.locale(ctd.languageLocale))
+ }
+ }
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Label {
+ hspan: 4
+
+ //% "Date"
+ text: qsTrId("date_id") + ctd.emptyString
+ font.pixelSize: Style.fontSizeL
+ }
+
+ Label {
+ hspan: 6
+
+ text: new Date().toLocaleDateString(Qt.locale(ctd.languageLocale))
+ }
+ }
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Label {
+ hspan: 4
+
+ //% "Time"
+ text: qsTrId("time_id") + ctd.emptyString
+ font.pixelSize: Style.fontSizeL
+ }
+
+ Label {
+ hspan: 6
+
+ text: new Date().toLocaleTimeString(Qt.locale(ctd.languageLocale))
+ }
+ }
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Label {
+ hspan: 4
+
+ //% "Name"
+ text: qsTrId("name_id") + ctd.emptyString
+ font.pixelSize: Style.fontSizeL
+ }
+
+ TextField {
+ hspan: 6
+
+ forceFocusOnClick: true
+ }
+ }
+
+ Row {
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ Label {
+ hspan: 4
+
+ //% "Description"
+ text: qsTrId("description_id") + ctd.emptyString
+ font.pixelSize: Style.fontSizeL
+ }
+
+ Flickable {
+ height: Style.vspan(10)
+ width: Style.hspan(8)
+
+ contentWidth: txtDesc.width
+ contentHeight: txtDesc.height
+
+ clip: true
+
+ Label {
+ id: txtDesc
+ hspan: 8
+ vspan: 10
+
+ verticalAlignment: Text.AlignTop
+
+ //% "Demo description"
+ text: qsTrId("description_text_id") + ctd.emptyString
+ font.pixelSize: Style.fontSizeS
+ wrapMode: Text.Wrap
+ }
+ }
+ }
+ }
+ }
+ }
+ Component.onCompleted: {
+ console.log("RowLayout completed " + ctd.languageLocale)
+ }
+}
diff --git a/apps/com.theqtcompany.i18ndemo/README b/apps/com.theqtcompany.i18ndemo/README
new file mode 100644
index 0000000..0296c53
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/README
@@ -0,0 +1,12 @@
+* First time steps
+Run create_qm.sh script inside translations sub-folder to generate translated files.
+
+
+* Add support for additional language
+(1) Change directory to "translations" sub-folder.
+
+(2) Create file named "i18napp_<languageCode>.ts"
+
+(3) Run create_ts.sh to populate the .ts file created in step (2) above.
+
+(4) Edit "Languages.qml". Locate VirtualKeyboardSettings.activeLocales and add the languageCode to the existing list
diff --git a/apps/com.theqtcompany.i18ndemo/icon.png b/apps/com.theqtcompany.i18ndemo/icon.png
new file mode 100644
index 0000000..3ae6956
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/icon.png
Binary files differ
diff --git a/apps/com.theqtcompany.i18ndemo/info.yaml b/apps/com.theqtcompany.i18ndemo/info.yaml
new file mode 100644
index 0000000..b68611b
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/info.yaml
@@ -0,0 +1,14 @@
+formatVersion: 1
+formatType: am-application
+---
+id: 'com.theqtcompany.i18ndemo'
+icon: 'icon.png'
+code: 'I18NDemo.qml'
+runtime: 'qml-inprocess'
+name:
+ en: 'i18n Demo'
+ de: 'i18n Demo'
+
+categories: [ 'app' ]
+
+built-in: yes
diff --git a/apps/com.theqtcompany.i18ndemo/qt-icon.png b/apps/com.theqtcompany.i18ndemo/qt-icon.png
new file mode 100644
index 0000000..d76c636
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/qt-icon.png
Binary files differ
diff --git a/apps/com.theqtcompany.i18ndemo/translations/create_qm.sh b/apps/com.theqtcompany.i18ndemo/translations/create_qm.sh
new file mode 100755
index 0000000..7983757
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/create_qm.sh
@@ -0,0 +1,95 @@
+#!/bin/sh
+#****************************************************************************
+#**
+#** Copyright (C) 2016 The Qt Company.
+#** Contact: https://www.qt.io/licensing/
+#**
+#** This file is part of the Neptune IVI UI.
+#**
+#** $QT_BEGIN_LICENSE:GPL-QTAS$
+#** Commercial License Usage
+#** Licensees holding valid commercial Qt Automotive Suite licenses may use
+#** this file in accordance with the commercial license agreement provided
+#** with the Software or, alternatively, in accordance with the terms
+#** contained in a written agreement between you and The Qt Company. For
+#** licensing terms and conditions see https://www.qt.io/terms-conditions.
+#** For further information use the contact form at https://www.qt.io/contact-us.
+#**
+#** GNU General Public License Usage
+#** Alternatively, this file may be used under the terms of the GNU
+#** General Public License version 3 or (at your option) any later version
+#** approved by the KDE Free Qt Foundation. The licenses are as published by
+#** the Free Software Foundation and appearing in the file LICENSE.GPL3
+#** included in the packaging of this file. Please review the following
+#** information to ensure the GNU General Public License requirements will
+#** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+#**
+#** $QT_END_LICENSE$
+#**
+#** SPDX-License-Identifier: GPL-3.0
+#**
+#****************************************************************************
+
+QTBINPATH=~/Qt/5.7/gcc_64/bin
+INPUTFILESPATH=".."
+
+usageHelp()
+{
+ echo "$0"
+ echo "\t-h --help : Show this display usage"
+ echo "\t--qtdir=<path_to_qt_bin folder> : Sets path to lrelease executable"
+ echo "\t default value is $QTBINPATH"
+ echo ""
+}
+
+while [ "$1" != "" ]; do
+ PARAM=`echo $1 | awk -F= '{print $1}'`
+ VALUE=`echo $1 | awk -F= '{print $2}'`
+# echo "Param is " $PARAM
+# echo "Value is " $VALUE
+
+ case $PARAM in
+ -h | --help)
+ usageHelp
+ exit
+ ;;
+ --qtdir)
+ QTBINPATH=$VALUE
+ ;;
+ *)
+ echo "ERROR: unknown parameter \"$PARAM\""
+ usage
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+# TODO: If you intend to support new language, create a file as "i18napp_<langCode>.ts"
+langFileList=`ls *.ts`
+
+# Name of the file shall match the pattern as, i18napp_<langCode>
+# see the existing list above, de - german, ar - arabic, fr - french, etc.
+
+# TODO: Change this to match the path on your machine, if you have to
+translationCommand=$QTBINPATH/lrelease
+
+if [ ! -f $translationCommand ];
+then
+ echo "Set correct path pointing to location where lrelease binary can be found"
+ echo "Usually it is inside <QtInstallDir>/bin folder"
+ echo "Uage help:"
+ echo
+ usageHelp
+ exit
+fi
+
+echo
+echo "List of languages translated to: " $langFileList
+echo
+
+echo
+echo "Generating translation files"
+for tsFileName in $langFileList; do
+ $translationCommand -idbased $tsFileName -qm `basename -s .ts $tsFileName`.qm
+done
diff --git a/apps/com.theqtcompany.i18ndemo/translations/create_ts.sh b/apps/com.theqtcompany.i18ndemo/translations/create_ts.sh
new file mode 100755
index 0000000..e7ebb5e
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/create_ts.sh
@@ -0,0 +1,98 @@
+#!/bin/sh
+#/****************************************************************************
+#**
+#** Copyright (C) 2016 The Qt Company.
+#** Contact: https://www.qt.io/licensing/
+#**
+#** This file is part of the Neptune IVI UI.
+#**
+#** $QT_BEGIN_LICENSE:GPL-QTAS$
+#** Commercial License Usage
+#** Licensees holding valid commercial Qt Automotive Suite licenses may use
+#** this file in accordance with the commercial license agreement provided
+#** with the Software or, alternatively, in accordance with the terms
+#** contained in a written agreement between you and The Qt Company. For
+#** licensing terms and conditions see https://www.qt.io/terms-conditions.
+#** For further information use the contact form at https://www.qt.io/contact-us.
+#**
+#** GNU General Public License Usage
+#** Alternatively, this file may be used under the terms of the GNU
+#** General Public License version 3 or (at your option) any later version
+#** approved by the KDE Free Qt Foundation. The licenses are as published by
+#** the Free Software Foundation and appearing in the file LICENSE.GPL3
+#** included in the packaging of this file. Please review the following
+#** information to ensure the GNU General Public License requirements will
+#** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+#**
+#** $QT_END_LICENSE$
+#**
+#** SPDX-License-Identifier: GPL-3.0
+#**
+#****************************************************************************/
+
+QTBINPATH=~/Qt/5.7/gcc_64/bin
+INPUTFILESPATH=".."
+
+usageHelp()
+{
+ echo "$0"
+ echo "\t-h --help : Show this display usage"
+ echo "\t--qtdir=<path_to_qt_bin folder> : Sets path to lupdate executable"
+ echo "\t default value is $QTBINPATH"
+ echo ""
+}
+
+while [ "$1" != "" ]; do
+ PARAM=`echo $1 | awk -F= '{print $1}'`
+ VALUE=`echo $1 | awk -F= '{print $2}'`
+# echo "Param is " $PARAM
+# echo "Value is " $VALUE
+
+ case $PARAM in
+ -h | --help)
+ usageHelp
+ exit
+ ;;
+ --qtdir)
+ QTBINPATH=$VALUE
+ ;;
+ *)
+ echo "ERROR: unknown parameter \"$PARAM\""
+ usage
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+appPrefix="i18napp_"
+
+# TODO: If you intend to support new language, add to this list
+langFileList="en_GB fi_FI de_DE ar_AR fr_FR ko_KR ja_JP ru_RU zh_CN zh_TW"
+# Name of the file shall match the pattern as, i18napp_<langCode>
+# see the existing list above, de - german, ar - arabic, fr - french, etc.
+
+# TODO: Change this to match the path on your machine, if you have to
+translationCommand=$QTBINPATH/lupdate
+
+if [ ! -f $translationCommand ];
+then
+ echo "Set correct path pointing to location where lupdate binary can be found"
+ echo "Usually it is inside <QtInstallDir>/bin folder"
+ echo "Uage help:"
+ echo
+ usageHelp
+ exit
+fi
+
+inputFiles=$INPUTFILESPATH/*.qml
+
+echo
+echo "List of languages supported are: " $langFileList
+echo
+
+echo
+echo "Generating input files for translation"
+for tsFileName in $langFileList; do
+ $translationCommand $inputFiles -ts $appPrefix$tsFileName.ts
+done
diff --git a/apps/com.theqtcompany.i18ndemo/translations/i18napp_ar_AR.ts b/apps/com.theqtcompany.i18ndemo/translations/i18napp_ar_AR.ts
new file mode 100644
index 0000000..e082bd3
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/i18napp_ar_AR.ts
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="ar_EG">
+<context>
+ <name></name>
+ <message id="page_title_id">
+ <location filename="../I18NDemo.qml" line="56"/>
+ <source>Internationalization and Localization</source>
+ <translation>وتحديد مكانinternationalization</translation>
+ </message>
+ <message id="lang_selection_id">
+ <location filename="../Languages.qml" line="97"/>
+ <source>Language Selection</source>
+ <translation>لغة إنتقاء</translation>
+ </message>
+ <message id="number_id">
+ <location filename="../Languages.qml" line="154"/>
+ <source>Number</source>
+ <translation>عَدَدُهُم</translation>
+ </message>
+ <message id="currency_id">
+ <location filename="../Languages.qml" line="173"/>
+ <source>Currency</source>
+ <translation>عملة</translation>
+ </message>
+ <message id="date_id">
+ <location filename="../Languages.qml" line="191"/>
+ <source>Date</source>
+ <translation>تَارِيخ</translation>
+ </message>
+ <message id="time_id">
+ <location filename="../Languages.qml" line="209"/>
+ <source>Time</source>
+ <translation>وَقت</translation>
+ </message>
+ <message id="name_id">
+ <location filename="../Languages.qml" line="227"/>
+ <source>Name</source>
+ <translation>اِسماً</translation>
+ </message>
+ <message id="description_id">
+ <location filename="../Languages.qml" line="245"/>
+ <source>Description</source>
+ <translation>وصف</translation>
+ </message>
+ <message id="description_text_id">
+ <location filename="../Languages.qml" line="266"/>
+ <source>Demo description</source>
+ <translation>internationalization يعني يصمّم برمجيّة تطبيق so that هو يستطيع كنت كيّفت إلى مختلف لغة ومنطقة دون هندسة تغير. تحديد مكان يعني يكيّف يدوّل برمجيّة لمنطقة خاصّ أو لغة ب يضيف عنصر spécifique (مثل تاريخ، وقت، ورقم شكل) ويترجم نص. لوحة مفاتيح فعليّ أنّ يساند لوحة مفاتيح تصميم ومدخل طريقة a جزءا رئيسيا الinternationalization.</translation>
+ </message>
+</context>
+</TS>
diff --git a/apps/com.theqtcompany.i18ndemo/translations/i18napp_de_DE.ts b/apps/com.theqtcompany.i18ndemo/translations/i18napp_de_DE.ts
new file mode 100644
index 0000000..db9c889
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/i18napp_de_DE.ts
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="de_DE">
+<context>
+ <name></name>
+ <message id="page_title_id">
+ <location filename="../I18NDemo.qml" line="56"/>
+ <source>Internationalization and Localization</source>
+ <translation>Internationalisierung und Lokalisierung</translation>
+ </message>
+ <message id="lang_selection_id">
+ <location filename="../Languages.qml" line="97"/>
+ <source>Language Selection</source>
+ <translation>Sprachauswahl</translation>
+ </message>
+ <message id="number_id">
+ <location filename="../Languages.qml" line="154"/>
+ <source>Number</source>
+ <translation>Nummer</translation>
+ </message>
+ <message id="currency_id">
+ <location filename="../Languages.qml" line="173"/>
+ <source>Currency</source>
+ <translation>Währung</translation>
+ </message>
+ <message id="date_id">
+ <location filename="../Languages.qml" line="191"/>
+ <source>Date</source>
+ <translation>Datum</translation>
+ </message>
+ <message id="time_id">
+ <location filename="../Languages.qml" line="209"/>
+ <source>Time</source>
+ <translation>Zeit</translation>
+ </message>
+ <message id="name_id">
+ <location filename="../Languages.qml" line="227"/>
+ <source>Name</source>
+ <translation>Name</translation>
+ </message>
+ <message id="description_id">
+ <location filename="../Languages.qml" line="245"/>
+ <source>Description</source>
+ <translation>Beschreibung</translation>
+ </message>
+ <message id="description_text_id">
+ <location filename="../Languages.qml" line="266"/>
+ <source>Demo description</source>
+ <translation>Internationalisierung bedeutet eine Software-Anwendung entwerfen , so dass er ohne Konstruktionsänderungen zu verschiedenen Sprachen und Regionen angepasst werden. Lokalisierung bedeutet, durch Zugabe von locale- spezifischen Komponenten (wie Datum, Uhrzeit und Zahlenformate ) und übersetzen Text internationalisierte Software für eine bestimmte Region oder Sprache anzupassen. Eine virtuelle Tastatur, die Tastaturlayouts und Eingabemethoden ein wichtiger Bestandteil der Internationalisierung unterstützt .</translation>
+ </message>
+</context>
+</TS>
diff --git a/apps/com.theqtcompany.i18ndemo/translations/i18napp_en_GB.ts b/apps/com.theqtcompany.i18ndemo/translations/i18napp_en_GB.ts
new file mode 100644
index 0000000..bfe6003
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/i18napp_en_GB.ts
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="en_GB">
+<context>
+ <name></name>
+ <message id="page_title_id">
+ <location filename="../I18NDemo.qml" line="56"/>
+ <source>Internationalization and Localization</source>
+ <translation>Internationalization and Localization</translation>
+ </message>
+ <message id="lang_selection_id">
+ <location filename="../Languages.qml" line="97"/>
+ <source>Language Selection</source>
+ <translation>Language Selection</translation>
+ </message>
+ <message id="number_id">
+ <location filename="../Languages.qml" line="154"/>
+ <source>Number</source>
+ <translation>Number</translation>
+ </message>
+ <message id="currency_id">
+ <location filename="../Languages.qml" line="173"/>
+ <source>Currency</source>
+ <translation>Currency</translation>
+ </message>
+ <message id="date_id">
+ <location filename="../Languages.qml" line="191"/>
+ <source>Date</source>
+ <translation>Date</translation>
+ </message>
+ <message id="time_id">
+ <location filename="../Languages.qml" line="209"/>
+ <source>Time</source>
+ <translation>Time</translation>
+ </message>
+ <message id="name_id">
+ <location filename="../Languages.qml" line="227"/>
+ <source>Name</source>
+ <translation>Name</translation>
+ </message>
+ <message id="description_id">
+ <location filename="../Languages.qml" line="245"/>
+ <source>Description</source>
+ <translation>Description</translation>
+ </message>
+ <message id="description_text_id">
+ <location filename="../Languages.qml" line="266"/>
+ <source>Demo description</source>
+ <translation>Internationalization means designing a software application so that it can be adapted to various languages and regions without engineering changes. Localization means adapting internationalized software for a specific region or language by adding locale-specific components (such as date, time, and number formats) and translating text. A virtual keyboard that supports keyboard layouts and input methods a key part of internationalization.</translation>
+ </message>
+</context>
+</TS>
diff --git a/apps/com.theqtcompany.i18ndemo/translations/i18napp_fi_FI.ts b/apps/com.theqtcompany.i18ndemo/translations/i18napp_fi_FI.ts
new file mode 100644
index 0000000..60f8a5e
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/i18napp_fi_FI.ts
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="fi_FI">
+<context>
+ <name></name>
+ <message id="page_title_id">
+ <location filename="../I18NDemo.qml" line="56"/>
+ <source>Internationalization and Localization</source>
+ <translation>Kansainvälistäminen ja lokalisointi</translation>
+ </message>
+ <message id="lang_selection_id">
+ <location filename="../Languages.qml" line="97"/>
+ <source>Language Selection</source>
+ <translation>Kielivalinta</translation>
+ </message>
+ <message id="number_id">
+ <location filename="../Languages.qml" line="154"/>
+ <source>Number</source>
+ <translation>Numero</translation>
+ </message>
+ <message id="currency_id">
+ <location filename="../Languages.qml" line="173"/>
+ <source>Currency</source>
+ <translation>Rahayksikkö</translation>
+ </message>
+ <message id="date_id">
+ <location filename="../Languages.qml" line="191"/>
+ <source>Date</source>
+ <translation>Päiväys</translation>
+ </message>
+ <message id="time_id">
+ <location filename="../Languages.qml" line="209"/>
+ <source>Time</source>
+ <translation>Kellonaika</translation>
+ </message>
+ <message id="name_id">
+ <location filename="../Languages.qml" line="227"/>
+ <source>Name</source>
+ <translation>Nimi</translation>
+ </message>
+ <message id="description_id">
+ <location filename="../Languages.qml" line="245"/>
+ <source>Description</source>
+ <translation>Kuvaus</translation>
+ </message>
+ <message id="description_text_id">
+ <location filename="../Languages.qml" line="266"/>
+ <source>Demo description</source>
+ <translation>Kansainvälistäminen tarkoittaa sellaisen ohjelmiston suunnittelua, joka voidaan muokata usealle kielelle ilman koodimuutoksia. Lokalisoinnissa kyseinen ohjelmisto käännetään halutulle kielelle sekä mukautetaan sen kieliasuun ottaen huomioon alueelle tyypilliset ilmaisumuodot (kuten päivämäärä, kellonaika ja numeroformaatit). Lokalisoinnin piiriin kuuluvat myös erilaisia näppäimistöjä sekä kirjoitusjärjestelmiä tukevat virtuaalinäppäimistöt.</translation>
+ </message>
+</context>
+</TS>
diff --git a/apps/com.theqtcompany.i18ndemo/translations/i18napp_fr_FR.ts b/apps/com.theqtcompany.i18ndemo/translations/i18napp_fr_FR.ts
new file mode 100644
index 0000000..c54aff7
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/i18napp_fr_FR.ts
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="fr_FR">
+<context>
+ <name></name>
+ <message id="page_title_id">
+ <location filename="../I18NDemo.qml" line="56"/>
+ <source>Internationalization and Localization</source>
+ <translation>Internationalisation et régionalisation</translation>
+ </message>
+ <message id="lang_selection_id">
+ <location filename="../Languages.qml" line="97"/>
+ <source>Language Selection</source>
+ <translation>Sélection de langue</translation>
+ </message>
+ <message id="number_id">
+ <location filename="../Languages.qml" line="154"/>
+ <source>Number</source>
+ <translation>Numéro</translation>
+ </message>
+ <message id="currency_id">
+ <location filename="../Languages.qml" line="173"/>
+ <source>Currency</source>
+ <translation>Monnaie</translation>
+ </message>
+ <message id="date_id">
+ <location filename="../Languages.qml" line="191"/>
+ <source>Date</source>
+ <translation>Date</translation>
+ </message>
+ <message id="time_id">
+ <location filename="../Languages.qml" line="209"/>
+ <source>Time</source>
+ <translation>Heure</translation>
+ </message>
+ <message id="name_id">
+ <location filename="../Languages.qml" line="227"/>
+ <source>Name</source>
+ <translation>Nom</translation>
+ </message>
+ <message id="description_id">
+ <location filename="../Languages.qml" line="245"/>
+ <source>Description</source>
+ <translation>Description</translation>
+ </message>
+ <message id="description_text_id">
+ <location filename="../Languages.qml" line="266"/>
+ <source>Demo description</source>
+ <translation>L’internationalisation est la conception de toute application logicielle de sorte qu&apos;elle puisse être adaptée à différentes langues et régions sans modifications techniques. La régionalisation est l’adaptation d&apos;une application internationalisée pour une région ou un langage spécifique en ajoutant des composants spécifiques aux paramètres régionaux (tels que la date, l&apos;heure et les formats numériques) ainsi que la traduction du texte. Un clavier virtuel qui prend en charge la disposition des claviers et méthodes d’entrée est un élément clé de l’internationalisation.</translation>
+ </message>
+</context>
+</TS>
diff --git a/apps/com.theqtcompany.i18ndemo/translations/i18napp_ja_JP.ts b/apps/com.theqtcompany.i18ndemo/translations/i18napp_ja_JP.ts
new file mode 100644
index 0000000..7b80c77
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/i18napp_ja_JP.ts
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="ja_JP">
+<context>
+ <name></name>
+ <message id="page_title_id">
+ <location filename="../I18NDemo.qml" line="56"/>
+ <source>Internationalization and Localization</source>
+ <translation>国際化と地域化</translation>
+ </message>
+ <message id="lang_selection_id">
+ <location filename="../Languages.qml" line="97"/>
+ <source>Language Selection</source>
+ <translation>言語の選択</translation>
+ </message>
+ <message id="number_id">
+ <location filename="../Languages.qml" line="154"/>
+ <source>Number</source>
+ <translation>数値</translation>
+ </message>
+ <message id="currency_id">
+ <location filename="../Languages.qml" line="173"/>
+ <source>Currency</source>
+ <translation>通貨</translation>
+ </message>
+ <message id="date_id">
+ <location filename="../Languages.qml" line="191"/>
+ <source>Date</source>
+ <translation>日付</translation>
+ </message>
+ <message id="time_id">
+ <location filename="../Languages.qml" line="209"/>
+ <source>Time</source>
+ <translation>時刻</translation>
+ </message>
+ <message id="name_id">
+ <location filename="../Languages.qml" line="227"/>
+ <source>Name</source>
+ <translation>名前</translation>
+ </message>
+ <message id="description_id">
+ <location filename="../Languages.qml" line="245"/>
+ <source>Description</source>
+ <translation>説明</translation>
+ </message>
+ <message id="description_text_id">
+ <location filename="../Languages.qml" line="266"/>
+ <source>Demo description</source>
+ <translation>国際化はアプリケーションを様々な言語や地域に対応させるという意味です。地域化は国際化されたアプリケーションを特定の地域や言語に対応するという意味で、日付や時刻や数字のフォーマットの定義や翻訳の追加などが該当します。様々なレイアウトやインプットメソッドに対応可能なソフトウェアキーボードは国際化の重要なポイントです。</translation>
+ </message>
+</context>
+</TS>
diff --git a/apps/com.theqtcompany.i18ndemo/translations/i18napp_ko_KR.ts b/apps/com.theqtcompany.i18ndemo/translations/i18napp_ko_KR.ts
new file mode 100644
index 0000000..62b65bf
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/i18napp_ko_KR.ts
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="ko_KR">
+<context>
+ <name></name>
+ <message id="page_title_id">
+ <location filename="../I18NDemo.qml" line="56"/>
+ <source>Internationalization and Localization</source>
+ <translation>국제화 그리고 현지화</translation>
+ </message>
+ <message id="lang_selection_id">
+ <location filename="../Languages.qml" line="97"/>
+ <source>Language Selection</source>
+ <translation>언어 선택</translation>
+ </message>
+ <message id="number_id">
+ <location filename="../Languages.qml" line="154"/>
+ <source>Number</source>
+ <translation>숫자</translation>
+ </message>
+ <message id="currency_id">
+ <location filename="../Languages.qml" line="173"/>
+ <source>Currency</source>
+ <translation>통화</translation>
+ </message>
+ <message id="date_id">
+ <location filename="../Languages.qml" line="191"/>
+ <source>Date</source>
+ <translation>날짜</translation>
+ </message>
+ <message id="time_id">
+ <location filename="../Languages.qml" line="209"/>
+ <source>Time</source>
+ <translation>시간</translation>
+ </message>
+ <message id="name_id">
+ <location filename="../Languages.qml" line="227"/>
+ <source>Name</source>
+ <translation>이름</translation>
+ </message>
+ <message id="description_id">
+ <location filename="../Languages.qml" line="245"/>
+ <source>Description</source>
+ <translation>설명</translation>
+ </message>
+ <message id="description_text_id">
+ <location filename="../Languages.qml" line="266"/>
+ <source>Demo description</source>
+ <translation> 소프트웨어의 국제화 란 기술적인 변경 없이 다양한 언어들과 지역들에 맞추어질 수 있도록 소프트웨어 어플리케이션을 설계하는 것을 의미합니다. 지역화 란 국제화가 적용되어 있는 소프트웨어를 특정한 지역 또는 언어에 대해 해당 지역특성을 갖는 요소들 (예를 들어 날짜, 시간, 숫자 표시 방식)과 텍스트 번역을 적용하는 것을 의미 합니다. 키보드의 키 배치와 입력방식을 지원하는 Virtual Keyboard (가상 키보드)는 소프트웨어의 국제화에 대해 필수적인 요소입니다.</translation>
+ </message>
+</context>
+</TS>
diff --git a/apps/com.theqtcompany.i18ndemo/translations/i18napp_ru_RU.ts b/apps/com.theqtcompany.i18ndemo/translations/i18napp_ru_RU.ts
new file mode 100644
index 0000000..82c666e
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/i18napp_ru_RU.ts
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="ru_RU">
+<context>
+ <name></name>
+ <message id="page_title_id">
+ <location filename="../I18NDemo.qml" line="56"/>
+ <source>Internationalization and Localization</source>
+ <translation>Язык и региональные стандарты</translation>
+ </message>
+ <message id="lang_selection_id">
+ <location filename="../Languages.qml" line="97"/>
+ <source>Language Selection</source>
+ <translation>Выбор языка</translation>
+ </message>
+ <message id="number_id">
+ <location filename="../Languages.qml" line="154"/>
+ <source>Number</source>
+ <translation>Число</translation>
+ </message>
+ <message id="currency_id">
+ <location filename="../Languages.qml" line="173"/>
+ <source>Currency</source>
+ <translation>Валюта</translation>
+ </message>
+ <message id="date_id">
+ <location filename="../Languages.qml" line="191"/>
+ <source>Date</source>
+ <translation>Дата</translation>
+ </message>
+ <message id="time_id">
+ <location filename="../Languages.qml" line="209"/>
+ <source>Time</source>
+ <translation>Время</translation>
+ </message>
+ <message id="name_id">
+ <location filename="../Languages.qml" line="227"/>
+ <source>Name</source>
+ <translation>Ваше имя</translation>
+ </message>
+ <message id="description_id">
+ <location filename="../Languages.qml" line="245"/>
+ <source>Description</source>
+ <translation>Описание</translation>
+ </message>
+ <message id="description_text_id">
+ <location filename="../Languages.qml" line="266"/>
+ <source>Demo description</source>
+ <translation>Интернационализация при разработке программного обеспечения позволяет адаптировать ПО к различным региональным стандартам и языкам без дополнительного “инженерного&quot; вмешательства. Локализация означает адаптацию интернационализированного ПО к особенностям конкретного региона или языка посредством использования компонентов, учитывающих локальную специфику (форматы даты, времени, чисел и т.д.), и перевода текста. Ключевым компонентом интернационализации является виртуальная клавиатура, поддерживающая различные раскладки и методы ввода.</translation>
+ </message>
+</context>
+</TS>
diff --git a/apps/com.theqtcompany.i18ndemo/translations/i18napp_zh_CN.ts b/apps/com.theqtcompany.i18ndemo/translations/i18napp_zh_CN.ts
new file mode 100644
index 0000000..f05c5da
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/i18napp_zh_CN.ts
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="zh_CN">
+<context>
+ <name></name>
+ <message id="page_title_id">
+ <location filename="../I18NDemo.qml" line="56"/>
+ <source>Internationalization and Localization</source>
+ <translation>国际化和本地化</translation>
+ </message>
+ <message id="lang_selection_id">
+ <location filename="../Languages.qml" line="97"/>
+ <source>Language Selection</source>
+ <translation>语言选择</translation>
+ </message>
+ <message id="number_id">
+ <location filename="../Languages.qml" line="154"/>
+ <source>Number</source>
+ <translation>数字</translation>
+ </message>
+ <message id="currency_id">
+ <location filename="../Languages.qml" line="173"/>
+ <source>Currency</source>
+ <translation>货币</translation>
+ </message>
+ <message id="date_id">
+ <location filename="../Languages.qml" line="191"/>
+ <source>Date</source>
+ <translation>日期</translation>
+ </message>
+ <message id="time_id">
+ <location filename="../Languages.qml" line="209"/>
+ <source>Time</source>
+ <translation>时间</translation>
+ </message>
+ <message id="name_id">
+ <location filename="../Languages.qml" line="227"/>
+ <source>Name</source>
+ <translation>名称</translation>
+ </message>
+ <message id="description_id">
+ <location filename="../Languages.qml" line="245"/>
+ <source>Description</source>
+ <translation>描述</translation>
+ </message>
+ <message id="description_text_id">
+ <location filename="../Languages.qml" line="266"/>
+ <source>Demo description</source>
+ <translation>国际化是指一个应用程序被设计为可以无需修改的适应不同的语言和区域。本地化是指为通过添加地区化的组件(如日期、时间和数字格式)和文字翻译,实现国际化程序对特定区域或语言的支持。一个支持键盘布局和输入方法的虚拟键盘,是国际化的关键之一。</translation>
+ </message>
+</context>
+</TS>
diff --git a/apps/com.theqtcompany.i18ndemo/translations/i18napp_zh_TW.ts b/apps/com.theqtcompany.i18ndemo/translations/i18napp_zh_TW.ts
new file mode 100644
index 0000000..c32610d
--- /dev/null
+++ b/apps/com.theqtcompany.i18ndemo/translations/i18napp_zh_TW.ts
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="zh_TW">
+<context>
+ <name></name>
+ <message id="page_title_id">
+ <location filename="../I18NDemo.qml" line="56"/>
+ <source>Internationalization and Localization</source>
+ <translation>國際化和本地化</translation>
+ </message>
+ <message id="lang_selection_id">
+ <location filename="../Languages.qml" line="97"/>
+ <source>Language Selection</source>
+ <translation>語言選擇</translation>
+ </message>
+ <message id="number_id">
+ <location filename="../Languages.qml" line="154"/>
+ <source>Number</source>
+ <translation>數字</translation>
+ </message>
+ <message id="currency_id">
+ <location filename="../Languages.qml" line="173"/>
+ <source>Currency</source>
+ <translation>貨幣</translation>
+ </message>
+ <message id="date_id">
+ <location filename="../Languages.qml" line="191"/>
+ <source>Date</source>
+ <translation>日期</translation>
+ </message>
+ <message id="time_id">
+ <location filename="../Languages.qml" line="209"/>
+ <source>Time</source>
+ <translation>時間</translation>
+ </message>
+ <message id="name_id">
+ <location filename="../Languages.qml" line="227"/>
+ <source>Name</source>
+ <translation>名稱</translation>
+ </message>
+ <message id="description_id">
+ <location filename="../Languages.qml" line="245"/>
+ <source>Description</source>
+ <translation>描述</translation>
+ </message>
+ <message id="description_text_id">
+ <location filename="../Languages.qml" line="266"/>
+ <source>Demo description</source>
+ <translation>國際化是指壹個應用程式被設計為可以無需修改的適應不同的語言和區域。本地化是指為通過添加地區化的組件(如日期、時間和數字格式)和文字翻譯,實現國際化程式對特定區域或語言的支持。壹個支持鍵盤布局和輸入方法的虛擬鍵盤,是國際化的關鍵之壹。</translation>
+ </message>
+</context>
+</TS>
diff --git a/neptuneui.pro b/neptuneui.pro
index b3e826a..34b469b 100644
--- a/neptuneui.pro
+++ b/neptuneui.pro
@@ -1,7 +1,8 @@
TEMPLATE = subdirs
SUBDIRS = plugins/datasource \
- plugins/screenManager
+ plugins/screenManager \
+ plugins/comtqci18ndemo
qml.files = apps imports sysui i18n am-config.yaml Main*.qml
diff --git a/plugins/comtqci18ndemo/comtqci18ndemo.cpp b/plugins/comtqci18ndemo/comtqci18ndemo.cpp
new file mode 100644
index 0000000..90b7226
--- /dev/null
+++ b/plugins/comtqci18ndemo/comtqci18ndemo.cpp
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Neptune IVI UI.
+**
+** $QT_BEGIN_LICENSE:GPL-QTAS$
+** Commercial License Usage
+** Licensees holding valid commercial Qt Automotive Suite licenses may use
+** this file in accordance with the commercial license agreement provided
+** with the Software or, alternatively, in accordance with the terms
+** contained in a written agreement between you and The Qt Company. For
+** licensing terms and conditions see https://www.qt.io/terms-conditions.
+** For further information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+** SPDX-License-Identifier: GPL-3.0
+**
+****************************************************************************/
+
+#include "comtqci18ndemo.h"
+#include <QGuiApplication>
+#include <QDebug>
+
+ComTQCi18nDemo::ComTQCi18nDemo(QObject *parent)
+ : QObject(parent),
+ m_languageLocale(""),
+ m_languageFilePath(""),
+ m_languageFilePrefix("")
+{
+}
+
+void ComTQCi18nDemo::setPrefix(QString languageFilePrefix)
+{
+ qDebug() << "File prefix: " << languageFilePrefix;
+
+ m_languageFilePrefix = languageFilePrefix;
+}
+
+void ComTQCi18nDemo::setPath(QUrl languageFilePath)
+{
+ qDebug() << "File path: " << languageFilePath.toLocalFile();
+
+ m_languageFilePath = languageFilePath.toLocalFile();
+}
+
+void ComTQCi18nDemo::setLanguageLocale(QString languageLocale)
+{
+ qDebug() << "Locale: " << languageLocale;
+
+ if (m_languageLocale != languageLocale) {
+ if ( loadTranslationFile(languageLocale) ) {
+ m_languageLocale = languageLocale;
+
+ emit languageLocaleChanged();
+ emit languageChanged();
+ }
+ }
+}
+
+QString ComTQCi18nDemo::languageLocale() const
+{
+ return m_languageLocale;
+}
+
+QString ComTQCi18nDemo::emptyString() const
+{
+ return "";
+}
+
+bool ComTQCi18nDemo::loadTranslationFile(QString &langLocale)
+{
+ QString fileToLoad(m_languageFilePath + m_languageFilePrefix + "_");
+ fileToLoad += langLocale + ".qm";
+
+ qDebug() << "File to load: " << fileToLoad;
+
+ if ( m_translator.load(fileToLoad) ) {
+ qDebug() << "Translation file loaded";
+ qApp->installTranslator(&m_translator);
+
+ return true;
+ }
+
+ qDebug() << "Failed to load translation file";
+
+ return false;
+}
diff --git a/plugins/comtqci18ndemo/comtqci18ndemo.h b/plugins/comtqci18ndemo/comtqci18ndemo.h
new file mode 100644
index 0000000..ddb4320
--- /dev/null
+++ b/plugins/comtqci18ndemo/comtqci18ndemo.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Neptune IVI UI.
+**
+** $QT_BEGIN_LICENSE:GPL-QTAS$
+** Commercial License Usage
+** Licensees holding valid commercial Qt Automotive Suite licenses may use
+** this file in accordance with the commercial license agreement provided
+** with the Software or, alternatively, in accordance with the terms
+** contained in a written agreement between you and The Qt Company. For
+** licensing terms and conditions see https://www.qt.io/terms-conditions.
+** For further information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+** SPDX-License-Identifier: GPL-3.0
+**
+****************************************************************************/
+
+#ifndef COMTQCI18NDEMO_H
+#define COMTQCI18NDEMO_H
+
+#include <QtCore/QObject>
+#include <QTranslator>
+#include <QUrl>
+
+class ComTQCi18nDemo : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(QString languageLocale READ languageLocale WRITE setLanguageLocale NOTIFY languageLocaleChanged)
+ Q_PROPERTY(QString emptyString READ emptyString NOTIFY languageChanged)
+
+public:
+ explicit ComTQCi18nDemo(QObject *parent = 0);
+
+ Q_INVOKABLE void setPrefix(QString languageFilePrefix);
+ Q_INVOKABLE void setPath(QUrl languageFilePath);
+
+ Q_INVOKABLE void setLanguageLocale(QString languageLocale);
+ QString languageLocale() const;
+
+ // Helper method to notify string change
+ QString emptyString() const;
+
+signals:
+ void languageLocaleChanged();
+ void languageChanged();
+
+protected:
+ bool loadTranslationFile(QString &langLocale);
+
+ QString m_languageLocale;
+ QString m_languageFilePath;
+ QString m_languageFilePrefix;
+
+ QTranslator m_translator;
+};
+
+#endif // COMTQCI18NDEMO_H
diff --git a/plugins/comtqci18ndemo/comtqci18ndemo.pro b/plugins/comtqci18ndemo/comtqci18ndemo.pro
new file mode 100644
index 0000000..bc692c0
--- /dev/null
+++ b/plugins/comtqci18ndemo/comtqci18ndemo.pro
@@ -0,0 +1,30 @@
+TEMPLATE = lib
+TARGET = comtqci18ndemoplugin
+QT += qml quick
+CONFIG += qt plugin c++11
+
+TARGET = $$qtLibraryTarget($$TARGET)
+uri = com.theqtcompany.comtqci18ndemo
+
+SOURCES += \
+ plugin.cpp \
+ comtqci18ndemo.cpp \
+
+HEADERS += \
+ comtqci18ndemo.h \
+
+OTHER_FILES = qmldir
+
+!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
+ copy_qmldir.target = $$OUT_PWD/qmldir
+ copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
+ copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
+ QMAKE_EXTRA_TARGETS += copy_qmldir
+ PRE_TARGETDEPS += $$copy_qmldir.target
+}
+
+qmldir.files = qmldir
+installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
+qmldir.path = $$installPath
+target.path = $$installPath
+INSTALLS += target qmldir
diff --git a/plugins/comtqci18ndemo/plugin.cpp b/plugins/comtqci18ndemo/plugin.cpp
new file mode 100644
index 0000000..cd4b6c5
--- /dev/null
+++ b/plugins/comtqci18ndemo/plugin.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 Pelagicore AG
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the Neptune IVI UI.
+**
+** $QT_BEGIN_LICENSE:GPL-QTAS$
+** Commercial License Usage
+** Licensees holding valid commercial Qt Automotive Suite licenses may use
+** this file in accordance with the commercial license agreement provided
+** with the Software or, alternatively, in accordance with the terms
+** contained in a written agreement between you and The Qt Company. For
+** licensing terms and conditions see https://www.qt.io/terms-conditions.
+** For further information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+** SPDX-License-Identifier: GPL-3.0
+**
+****************************************************************************/
+
+#include <QtQml/qqmlextensionplugin.h>
+#include <qqml.h>
+#include "comtqci18ndemo.h"
+
+class ComTQCi18nDemoPlugin : public QQmlExtensionPlugin
+{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0")
+public:
+ virtual void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == QLatin1String("com.theqtcompany.comtqci18ndemo"));
+
+ qmlRegisterType<ComTQCi18nDemo>(uri, 1, 0, "ComTQCi18nDemo");
+ }
+};
+
+#include "plugin.moc"
diff --git a/plugins/comtqci18ndemo/qmldir b/plugins/comtqci18ndemo/qmldir
new file mode 100644
index 0000000..8a23ec8
--- /dev/null
+++ b/plugins/comtqci18ndemo/qmldir
@@ -0,0 +1,2 @@
+module com.theqtcompany.comtqci18ndemo
+plugin comtqci18ndemoplugin