diff --git a/example/ExampleShareUI.qml b/example/ExampleShareUI.qml index f4badc7..5528def 100644 --- a/example/ExampleShareUI.qml +++ b/example/ExampleShareUI.qml @@ -61,7 +61,9 @@ ShareDialog { Label { anchors.centerIn:parent width: viewWidth - text: "Example Test Share UI" + //: Label for example share UI + //% "Example Test Share UI" + text: qsTrId("example-test-share-ui-la-id") horizontalAlignment: Text.AlignHCenter } } @@ -77,8 +79,9 @@ ShareDialog { } DialogHeader { - // TODO: Localization not supported for 3rd party plugins yet - acceptText: "Example Share" + //: Header for example share plugin + //% "Example Share" + acceptText: qsTrId("example-share-he-id") } } diff --git a/example/example.pro b/example/example.pro index f361ee0..6ba0a69 100644 --- a/example/example.pro +++ b/example/example.pro @@ -20,14 +20,12 @@ SOURCES += \ OTHER_FILES += \ ExampleShareUI.qml - shareui.files = *.qml shareui.path = /usr/share/nemo-transferengine/plugins target.path = /usr/lib/nemo-transferengine/plugins INSTALLS += target shareui - TS_FILE = $$OUT_PWD/example_share_plugin.ts EE_QM = $$OUT_PWD/example_share_plugin_eng_en.qm @@ -47,17 +45,28 @@ engineering_english.depends = ts engineering_english.input = $$TS_FILE engineering_english.output = $$EE_QM -engineering_english_install.path = /usr/share/translations +engineering_english_install.path = /usr/share/translations/nemotransferengine engineering_english_install.files = $$EE_QM engineering_english_install.CONFIG += no_check_exist -QMAKE_EXTRA_TARGETS += ts engineering_english +TS_FI_FILE = translations/example_share_plugin_fi.ts +QM_FI_FILE = example_share_plugin_fi.qm + +finnish.commands += lrelease -idbased $$TS_FI_FILE -qm $$QM_FI_FILE +finnish.CONFIG += no_check_exist no_link +finnish.depends = ts +finnish.input = $$TS_FI_FILE +finnish.output = $$QM_FI_FILE -PRE_TARGETDEPS += ts engineering_english +finnish_install.path = /usr/share/translations/nemotransferengine +finnish_install.files = $$QM_FI_FILE +finnish_install.CONFIG += no_check_exist -INSTALLS += ts_install engineering_english_install +QMAKE_EXTRA_TARGETS += ts engineering_english finnish +PRE_TARGETDEPS += ts engineering_english finnish +INSTALLS += ts_install engineering_english_install finnish_install OTHER_FILES += \ rpm/* diff --git a/example/exampleplugininfo.cpp b/example/exampleplugininfo.cpp index 82bb802..2f27cfb 100644 --- a/example/exampleplugininfo.cpp +++ b/example/exampleplugininfo.cpp @@ -57,7 +57,9 @@ void ExamplePluginInfo::query() // TODO: Translations for 3rd party plugins is not yet supported by Sailfish OS. // Adding support there later, but for now just use what ever non-translated // string here. This string will be visible in the share method list. - info.displayName = "Example Display Name"; + //: Display name for example share plugin + //% "Example plugin" + info.displayName = qtTrId("example-localization-li-id"); // Method ID is a unique identifier for this plugin. It is used to identify which share plugin should be // used for starting the sharing. diff --git a/example/rpm/example.spec b/example/rpm/example.spec index 5b07987..a1eeff4 100644 --- a/example/rpm/example.spec +++ b/example/rpm/example.spec @@ -22,7 +22,7 @@ Requires: declarative-transferengine-qt5 >= 0.0.44 %defattr(-,root,root,-) %{_libdir}/nemo-transferengine/plugins/*shareplugin.so %{_datadir}/nemo-transferengine/plugins/*.qml -%{_datadir}/translations/example_share_plugin_eng_en.qm +%{_datadir}/translations/nemotransferengine/*.qm %package ts-devel Summary: Translation source for Transfer Engine share plugins diff --git a/example/translations/example_share_plugin_fi.ts b/example/translations/example_share_plugin_fi.ts new file mode 100644 index 0000000..e700836 --- /dev/null +++ b/example/translations/example_share_plugin_fi.ts @@ -0,0 +1,32 @@ + + + + + + + + Example Test Share UI + Esimerkki testi UI + + + + Example Share + Header for example share plugin + Jakoesimerkki + + + + Example plugin + Display name for example share plugin + Esimerkkiplugari + + + + ExampleUploader + + + Example + Esimerkki + + +