From f0e285381800c0809e5bfd3a4871a2283ea10fb9 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Mon, 12 Aug 2013 15:24:03 +0200 Subject: Doc: Renamed and moved examples/qml/i18n to examples/qml/qml-i18n -the generated HTML page conflicts with the i18n.html page from qtdoc. -edited the content. Task-number: QTBUG-32580 Change-Id: I32ded1913d9faecb95e28043983e957ccd0e8749 Reviewed-by: Martin Smith --- examples/qml/i18n/doc/images/qml-i18n-example.png | Bin 1945 -> 0 bytes examples/qml/i18n/doc/src/i18n.qdoc | 55 ------------------- examples/qml/i18n/i18n.qml | 60 --------------------- examples/qml/i18n/i18n.qmlproject | 16 ------ examples/qml/i18n/i18n/base.ts | 12 ----- examples/qml/i18n/i18n/qml_en_AU.ts | 12 ----- examples/qml/i18n/i18n/qml_fr.ts | 12 ----- .../qml/qml-i18n/doc/images/qml-i18n-example.png | Bin 0 -> 1945 bytes examples/qml/qml-i18n/doc/src/i18n.qdoc | 55 +++++++++++++++++++ examples/qml/qml-i18n/i18n/base.ts | 12 +++++ examples/qml/qml-i18n/i18n/qml_en_AU.ts | 12 +++++ examples/qml/qml-i18n/i18n/qml_fr.ts | 12 +++++ examples/qml/qml-i18n/qml-i18n.qml | 60 +++++++++++++++++++++ examples/qml/qml-i18n/qml-i18n.qmlproject | 16 ++++++ examples/qml/qml.pro | 2 +- 15 files changed, 168 insertions(+), 168 deletions(-) delete mode 100644 examples/qml/i18n/doc/images/qml-i18n-example.png delete mode 100644 examples/qml/i18n/doc/src/i18n.qdoc delete mode 100644 examples/qml/i18n/i18n.qml delete mode 100644 examples/qml/i18n/i18n.qmlproject delete mode 100644 examples/qml/i18n/i18n/base.ts delete mode 100644 examples/qml/i18n/i18n/qml_en_AU.ts delete mode 100644 examples/qml/i18n/i18n/qml_fr.ts create mode 100644 examples/qml/qml-i18n/doc/images/qml-i18n-example.png create mode 100644 examples/qml/qml-i18n/doc/src/i18n.qdoc create mode 100644 examples/qml/qml-i18n/i18n/base.ts create mode 100644 examples/qml/qml-i18n/i18n/qml_en_AU.ts create mode 100644 examples/qml/qml-i18n/i18n/qml_fr.ts create mode 100644 examples/qml/qml-i18n/qml-i18n.qml create mode 100644 examples/qml/qml-i18n/qml-i18n.qmlproject diff --git a/examples/qml/i18n/doc/images/qml-i18n-example.png b/examples/qml/i18n/doc/images/qml-i18n-example.png deleted file mode 100644 index 02f645e702..0000000000 Binary files a/examples/qml/i18n/doc/images/qml-i18n-example.png and /dev/null differ diff --git a/examples/qml/i18n/doc/src/i18n.qdoc b/examples/qml/i18n/doc/src/i18n.qdoc deleted file mode 100644 index 39f2bf9a08..0000000000 --- a/examples/qml/i18n/doc/src/i18n.qdoc +++ /dev/null @@ -1,55 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: http://www.gnu.org/copyleft/fdl.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ -/*! - \title QML Examples - Internationalization - \example i18n - \image qml-i18n-example.png - \brief This is an internationalization example - - The QML runtime automatically loads a translation from the i18n subdirectory of the root - QML file, based on the system language. - - The files are created/updated by running: - -\code - lupdate i18n.qml -ts i18n/base.ts -\endcode - - Translations for new languages are created by copying i18n/base.ts to i18n/qml_.ts - The .ts files can then be edited with Linguist: - -\code - linguist i18n/qml_fr.ts -\endcode - - The run-time translation files are then generated by running: - -\code - lrelease i18n/*.ts -\endcode - -*/ diff --git a/examples/qml/i18n/i18n.qml b/examples/qml/i18n/i18n.qml deleted file mode 100644 index 00fc310a6c..0000000000 --- a/examples/qml/i18n/i18n.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Rectangle { - width: 640; height: 480 - - Column { - anchors.fill: parent; spacing: 20 - - Text { - text: "If a translation is available for the system language (eg. French) then the "+ - "string below will translated (eg. 'Bonjour'). Otherwise it will show 'Hello'." - width: parent.width; wrapMode: Text.WordWrap - } - - Text { - text: qsTr("Hello") - font.pointSize: 25; anchors.horizontalCenter: parent.horizontalCenter - } - } -} diff --git a/examples/qml/i18n/i18n.qmlproject b/examples/qml/i18n/i18n.qmlproject deleted file mode 100644 index 7ee5b76b92..0000000000 --- a/examples/qml/i18n/i18n.qmlproject +++ /dev/null @@ -1,16 +0,0 @@ -import QmlProject 1.1 - -Project { - mainFile: "i18n.qml" - - /* Include .qml, .js, and image files from current directory and subdirectories */ - QmlFiles { - directory: "." - } - JavaScriptFiles { - directory: "." - } - ImageFiles { - directory: "." - } -} diff --git a/examples/qml/i18n/i18n/base.ts b/examples/qml/i18n/i18n/base.ts deleted file mode 100644 index 82547a1f93..0000000000 --- a/examples/qml/i18n/i18n/base.ts +++ /dev/null @@ -1,12 +0,0 @@ - - - - - i18n - - - Hello - - - - diff --git a/examples/qml/i18n/i18n/qml_en_AU.ts b/examples/qml/i18n/i18n/qml_en_AU.ts deleted file mode 100644 index e991affe7f..0000000000 --- a/examples/qml/i18n/i18n/qml_en_AU.ts +++ /dev/null @@ -1,12 +0,0 @@ - - - - - i18n - - - Hello - G'day - - - diff --git a/examples/qml/i18n/i18n/qml_fr.ts b/examples/qml/i18n/i18n/qml_fr.ts deleted file mode 100644 index 365abd95c2..0000000000 --- a/examples/qml/i18n/i18n/qml_fr.ts +++ /dev/null @@ -1,12 +0,0 @@ - - - - - i18n - - - Hello - Bonjour - - - diff --git a/examples/qml/qml-i18n/doc/images/qml-i18n-example.png b/examples/qml/qml-i18n/doc/images/qml-i18n-example.png new file mode 100644 index 0000000000..02f645e702 Binary files /dev/null and b/examples/qml/qml-i18n/doc/images/qml-i18n-example.png differ diff --git a/examples/qml/qml-i18n/doc/src/i18n.qdoc b/examples/qml/qml-i18n/doc/src/i18n.qdoc new file mode 100644 index 0000000000..5a61906497 --- /dev/null +++ b/examples/qml/qml-i18n/doc/src/i18n.qdoc @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt 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 Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ +/*! + \title QML Examples - Internationalization + \example qml-i18n + \image qml-i18n-example.png + \brief This is an internationalization example + + The QML runtime automatically loads a translation from the i18n subdirectory of the root + QML file, based on the system language. + + The files are created or updated by running: + +\code + lupdate qml-i18n.qml -ts i18n/base.ts +\endcode + + Translations for new languages are created by copying \e i18n/base.ts to \e i18n/qml_.ts + The .ts files can then be edited with \l {Qt Linguist}: + +\code + linguist i18n/qml_fr.ts +\endcode + + The run-time translation files are then generated by running: + +\code + lrelease i18n/*.ts +\endcode + +*/ diff --git a/examples/qml/qml-i18n/i18n/base.ts b/examples/qml/qml-i18n/i18n/base.ts new file mode 100644 index 0000000000..07e00f3ad2 --- /dev/null +++ b/examples/qml/qml-i18n/i18n/base.ts @@ -0,0 +1,12 @@ + + + + + qml-i18n + + + Hello + + + + diff --git a/examples/qml/qml-i18n/i18n/qml_en_AU.ts b/examples/qml/qml-i18n/i18n/qml_en_AU.ts new file mode 100644 index 0000000000..e991affe7f --- /dev/null +++ b/examples/qml/qml-i18n/i18n/qml_en_AU.ts @@ -0,0 +1,12 @@ + + + + + i18n + + + Hello + G'day + + + diff --git a/examples/qml/qml-i18n/i18n/qml_fr.ts b/examples/qml/qml-i18n/i18n/qml_fr.ts new file mode 100644 index 0000000000..1784914f42 --- /dev/null +++ b/examples/qml/qml-i18n/i18n/qml_fr.ts @@ -0,0 +1,12 @@ + + + + + i18n + + + Hello + Bonjour + + + diff --git a/examples/qml/qml-i18n/qml-i18n.qml b/examples/qml/qml-i18n/qml-i18n.qml new file mode 100644 index 0000000000..00fc310a6c --- /dev/null +++ b/examples/qml/qml-i18n/qml-i18n.qml @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the examples of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.0 + +Rectangle { + width: 640; height: 480 + + Column { + anchors.fill: parent; spacing: 20 + + Text { + text: "If a translation is available for the system language (eg. French) then the "+ + "string below will translated (eg. 'Bonjour'). Otherwise it will show 'Hello'." + width: parent.width; wrapMode: Text.WordWrap + } + + Text { + text: qsTr("Hello") + font.pointSize: 25; anchors.horizontalCenter: parent.horizontalCenter + } + } +} diff --git a/examples/qml/qml-i18n/qml-i18n.qmlproject b/examples/qml/qml-i18n/qml-i18n.qmlproject new file mode 100644 index 0000000000..a1a56c2bb2 --- /dev/null +++ b/examples/qml/qml-i18n/qml-i18n.qmlproject @@ -0,0 +1,16 @@ +import QmlProject 1.1 + +Project { + mainFile: "qml-i18n.qml" + + /* Include .qml, .js, and image files from current directory and subdirectories */ + QmlFiles { + directory: "." + } + JavaScriptFiles { + directory: "." + } + ImageFiles { + directory: "." + } +} diff --git a/examples/qml/qml.pro b/examples/qml/qml.pro index 8d9cca047f..5ab155cb40 100644 --- a/examples/qml/qml.pro +++ b/examples/qml/qml.pro @@ -9,5 +9,5 @@ SUBDIRS += \ EXAMPLE_FILES = \ dynamicscene \ - i18n \ + qml-i18n \ locale -- cgit v1.2.3