Commit 2c68e586 authored by Marko Mattila's avatar Marko Mattila

Merge pull request #21 from zchydem/master

[transfer-engine] Updated example share plugin to use translations.
parents c8e368b7 ba2b5770
......@@ -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")
}
}
......@@ -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/*
......
......@@ -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.
......
......@@ -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
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="fi_FI">
<context>
<name></name>
<message id="example-test-share-ui-la-id">
<location filename="ExampleShareUI.qml" line="65"/>
<source>Example Test Share UI</source>
<translation>Esimerkki testi UI</translation>
</message>
<message id="example-share-he-id">
<location filename="ExampleShareUI.qml" line="83"/>
<source>Example Share</source>
<extracomment>Header for example share plugin</extracomment>
<translation>Jakoesimerkki</translation>
</message>
<message id="example-localization-li-id">
<location filename="exampleplugininfo.cpp" line="62"/>
<source>Example plugin</source>
<extracomment>Display name for example share plugin</extracomment>
<translation>Esimerkkiplugari</translation>
</message>
</context>
<context>
<name>ExampleUploader</name>
<message>
<location filename="exampleuploader.cpp" line="45"/>
<source>Example</source>
<translation>Esimerkki</translation>
</message>
</context>
</TS>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment