diff --git a/plasma/applets/ForeignCurrencies/Messages.sh b/plasma/applets/ForeignCurrencies/Messages.sh new file mode 100644 index 0000000..55abe90 --- /dev/null +++ b/plasma/applets/ForeignCurrencies/Messages.sh @@ -0,0 +1,11 @@ +#!bin/sh +# invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources +# the results are stored in a pseudo .cpp file to be picked up by xgettext. +$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp + +# call xgettext on all source files. If your sources have other filename +# extensions besides .cpp, and .h, just add them in the find call. +$XGETTEXT `find . -name \*.cpp -o -name \*.h -o -name \*.qml` -o $podir/alkimia-plasma-foreign-currencies.pot + +# Remove these two generated files again +rm rc.cpp diff --git a/plasma/applets/ForeignCurrencies/contents/ui/config/ConfigGeneral.qml b/plasma/applets/ForeignCurrencies/contents/ui/config/ConfigGeneral.qml index 8bea5e9..27a7153 100644 --- a/plasma/applets/ForeignCurrencies/contents/ui/config/ConfigGeneral.qml +++ b/plasma/applets/ForeignCurrencies/contents/ui/config/ConfigGeneral.qml @@ -1,161 +1,161 @@ import QtQuick 2.2 import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.2 import org.kde.plasma.core 2.0 as PlasmaCore Item { property string cfg_currencies ListModel { id: currenciesModel } Component.onCompleted: { var currencies = JSON.parse(plasmoid.configuration.currencies) currencies.forEach(function (line) { currenciesModel.append({ symbol: line.symbol }) }) } function currenciesModelChanged() { var newCurrenciesArray = [] for (var i = 0; i < currenciesModel.count; i++) { newCurrenciesArray.push({ symbol: currenciesModel.get(i).symbol }) } cfg_currencies = JSON.stringify(newCurrenciesArray) } Dialog { id: addCurrencyDialog - title: i18n('Add Currency Pair') + title: i18n("Add Currency Pair") width: 300 standardButtons: StandardButton.Ok | StandardButton.Cancel onAccepted: { if (symbolField.text !== "") { console.log("symbol: " + symbolField.text); currenciesModel.append({ symbol: symbolField.text }); currenciesModelChanged() close() } } TextField { id: symbolField - placeholderText: i18n('Paste currency pair symbol here') + placeholderText: i18n("Paste currency pair symbol here") width: parent.width } } ColumnLayout { anchors.left: parent.left anchors.right: parent.right Label { - text: i18n('Currency Pairs') + text: i18n("Currency Pairs") font.bold: true Layout.alignment: Qt.AlignLeft } Item { } TableView { id: currenciesTable width: parent.width TableViewColumn { id: symbolIdCol role: 'symbolId' - title: i18n('Symbol') + title: i18n("Symbol") // width: parent.width * 0.6 delegate: Label { text: styleData.value elide: Text.ElideRight anchors.left: parent ? parent.left : undefined anchors.leftMargin: 5 anchors.right: parent ? parent.right : undefined anchors.rightMargin: 5 } } TableViewColumn { - title: i18n('Action') + title: i18n("Action") // width: parent.width * 0.2 delegate: Item { GridLayout { height: parent.height columns: 3 rowSpacing: 0 Button { iconName: 'go-up' Layout.fillHeight: true onClicked: { currenciesModel.move(styleData.row, styleData.row - 1, 1) currenciesModelChanged() } enabled: styleData.row > 0 } Button { iconName: 'go-down' Layout.fillHeight: true onClicked: { currenciesModel.move(styleData.row, styleData.row + 1, 1) currenciesModelChanged() } enabled: styleData.row < currenciesModel.count - 1 } Button { iconName: 'list-remove' Layout.fillHeight: true onClicked: { currenciesModel.remove(styleData.row) currenciesModelChanged() } } } } } model: currenciesModel Layout.preferredHeight: 150 Layout.preferredWidth: parent.width Layout.columnSpan: 2 } Row { Layout.columnSpan: 2 Button { iconName: 'list-add' text: 'Add Currency Pair' onClicked: { addCurrencyDialog.open(); symbolField.text = '' symbolField.focus = true } } } } } diff --git a/plasma/applets/onlinequote/CMakeLists.txt b/plasma/applets/onlinequote/CMakeLists.txt index 07eb21f..a724d11 100644 --- a/plasma/applets/onlinequote/CMakeLists.txt +++ b/plasma/applets/onlinequote/CMakeLists.txt @@ -1,31 +1,32 @@ # We add our source code here set(SOURCES plasma-onlinequote.cpp) set(UI configwidget.ui) ki18n_wrap_ui(SOURCES ${UI}) # Now make sure all files get to the right place kde4_add_plugin(plasma_applet_onlinequote ${SOURCES}) target_link_libraries(plasma_applet_onlinequote alkimia ) if(BUILD_QT4) target_link_libraries(plasma_applet_onlinequote ${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ) set(PLUGIN_INSTALL_DIR "${KDE4_LIB_INSTALL_DIR}/kde4") set(SERVICES_INSTALL_DIR ${KDE4_SERVICES_INSTALL_DIR}) else() target_link_libraries(plasma_applet_onlinequote KF5::Package KF5::Plasma ) + add_definitions(-DTRANSLATION_DOMAIN=\"alkimia-plasma-onlinequote\") endif() install(TARGETS plasma_applet_onlinequote DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES plasma-applet-onlinequote.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/plasma/applets/onlinequote/Messages.sh b/plasma/applets/onlinequote/Messages.sh new file mode 100644 index 0000000..e73da07 --- /dev/null +++ b/plasma/applets/onlinequote/Messages.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +# invoke the extractrc script on all .ui, .rc, and .kcfg files in the sources +# the results are stored in a pseudo .cpp file to be picked up by xgettext. +$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp + +# call xgettext on all source files. If your sources have other filename +# extensions besides .cc, .cpp, and .h, just add them in the find call. +$XGETTEXT `find . -name \*.cc -o -name \*.cpp -o -name \*.h -name \*.qml` -o $podir/alkimia-plasma-onlinequote.pot + +# Remove this generated files +rm rc.cpp +