From 39e992988f21553df7e839f36ced75ca5bf8588c Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Wed, 5 May 2010 18:06:20 +1000 Subject: Fix i18n example. Add french translation to photoviewer demo. --- .../photoviewer/PhotoViewerCore/AlbumDelegate.qml | 2 +- demos/declarative/photoviewer/i18n/base.ts | 30 +++++++++++++++++++++ demos/declarative/photoviewer/i18n/qml_fr.qm | Bin 0 -> 268 bytes demos/declarative/photoviewer/i18n/qml_fr.ts | 30 +++++++++++++++++++++ demos/declarative/photoviewer/photoviewer.qml | 6 ++--- examples/declarative/i18n/i18n.qml | 30 ++++++++++++--------- 6 files changed, 81 insertions(+), 17 deletions(-) create mode 100644 demos/declarative/photoviewer/i18n/base.ts create mode 100644 demos/declarative/photoviewer/i18n/qml_fr.qm create mode 100644 demos/declarative/photoviewer/i18n/qml_fr.ts diff --git a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml index 142735f..71d3cdc 100644 --- a/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml +++ b/demos/declarative/photoviewer/PhotoViewerCore/AlbumDelegate.qml @@ -56,7 +56,7 @@ Component { Tag { anchors { horizontalCenter: parent.horizontalCenter; bottom: parent.bottom; bottomMargin: 10 } - frontLabel: tag; backLabel: "Delete"; flipped: mainWindow.editMode + frontLabel: tag; backLabel: qsTr("Remove"); flipped: mainWindow.editMode onTagChanged: rssModel.tags = tag onBackClicked: if (mainWindow.editMode) photosModel.remove(index); } diff --git a/demos/declarative/photoviewer/i18n/base.ts b/demos/declarative/photoviewer/i18n/base.ts new file mode 100644 index 0000000..1accfd2 --- /dev/null +++ b/demos/declarative/photoviewer/i18n/base.ts @@ -0,0 +1,30 @@ + + + + + AlbumDelegate + + + Remove + + + + + photoviewer + + + Add + + + + + Edit + + + + + Back + + + + diff --git a/demos/declarative/photoviewer/i18n/qml_fr.qm b/demos/declarative/photoviewer/i18n/qml_fr.qm new file mode 100644 index 0000000..c24fcbc Binary files /dev/null and b/demos/declarative/photoviewer/i18n/qml_fr.qm differ diff --git a/demos/declarative/photoviewer/i18n/qml_fr.ts b/demos/declarative/photoviewer/i18n/qml_fr.ts new file mode 100644 index 0000000..9f892db --- /dev/null +++ b/demos/declarative/photoviewer/i18n/qml_fr.ts @@ -0,0 +1,30 @@ + + + + + AlbumDelegate + + + Remove + Supprimer + + + + photoviewer + + + Add + Ajouter + + + + Edit + Éditer + + + + Back + Retour + + + diff --git a/demos/declarative/photoviewer/photoviewer.qml b/demos/declarative/photoviewer/photoviewer.qml index 4094294..e384f46 100644 --- a/demos/declarative/photoviewer/photoviewer.qml +++ b/demos/declarative/photoviewer/photoviewer.qml @@ -27,7 +27,7 @@ Rectangle { Column { spacing: 20; anchors { bottom: parent.bottom; right: parent.right; rightMargin: 20; bottomMargin: 20 } Button { - id: newButton; label: "New"; rotation: 3 + id: newButton; label: qsTr("Add"); rotation: 3 anchors.horizontalCenter: parent.horizontalCenter onClicked: { mainWindow.editMode = false @@ -36,7 +36,7 @@ Rectangle { } } Button { - id: deleteButton; label: "Delete"; rotation: -2; + id: deleteButton; label: qsTr("Edit"); rotation: -2; onClicked: mainWindow.editMode = !mainWindow.editMode anchors.horizontalCenter: parent.horizontalCenter } @@ -49,7 +49,7 @@ Rectangle { ListView { anchors.fill: parent; model: albumVisualModel.parts.browser; interactive: false } - Button { id: backButton; label: "Back"; rotation: 3; x: parent.width - backButton.width - 6; y: -backButton.height - 8 } + Button { id: backButton; label: qsTr("Back"); rotation: 3; x: parent.width - backButton.width - 6; y: -backButton.height - 8 } Rectangle { id: photosShade; color: 'black'; width: parent.width; height: parent.height; opacity: 0; visible: opacity != 0.0 } diff --git a/examples/declarative/i18n/i18n.qml b/examples/declarative/i18n/i18n.qml index 3b1279a..c3030b2 100644 --- a/examples/declarative/i18n/i18n.qml +++ b/examples/declarative/i18n/i18n.qml @@ -6,8 +6,9 @@ import Qt 4.7 // // The files are created/updated by running: // -// lupdate i18n.qml -ts i18n/*.ts +// lupdate i18n.qml -ts i18n/base.ts // +// Translations for new languages are created by copying i18n/base.ts to i18n/qml_.ts // The .ts files can then be edited with Linguist: // // linguist i18n/qml_fr.ts @@ -16,18 +17,21 @@ import Qt 4.7 // // lrelease i18n/*.ts // -// Translations for new languages are created by copying i18n/base.ts to i18n/qml_.ts -// and editing the result with Linguist. -// -Column { - Text { - text: "If a translation is available for the system language (eg. Franch) then the string below will translated (eg. 'Bonjour'). Otherwise is will show 'Hello'." - width: 200 - wrapMode: Text.WordWrap - } - Text { - text: qsTr("Hello") - font.pointSize: 25 +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 is will show 'Hello'." + width: parent.width; wrapMode: Text.WordWrap + } + + Text { + text: qsTr("Hello") + font.pointSize: 25; anchors.horizontalCenter: parent.horizontalCenter + } } } -- cgit v0.12