From 9f5ed252baa4e3863c0d11eb233c7d5e192843cc Mon Sep 17 00:00:00 2001 From: Yuri Chornoivan Date: Mon, 23 Dec 2019 19:10:22 +0200 Subject: [PATCH] Fix localization of the systemmonitor widget configuration window Summary: Currently, the common config window messages are neither extracted nor used in all 5 widgets. It is not possible to add several translation catalogs for a single QML widget thus the messages are extracted into all 5 widget catalogs. Idea of the fix by Victor Ryzhykh. Test Plan: Extraction tested to work as expected, translation should work too. Reviewers: #localization, #plasma, davidedmundson, ngraham Reviewed By: #plasma, davidedmundson, ngraham Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D26192 --- applets/systemmonitor/common/contents/ui/ConfigGeneral.qml | 2 +- applets/systemmonitor/cpu/Messages.sh | 2 +- applets/systemmonitor/diskactivity/Messages.sh | 2 +- applets/systemmonitor/diskusage/Messages.sh | 2 +- applets/systemmonitor/memory/Messages.sh | 2 +- applets/systemmonitor/net/Messages.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml b/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml index 2d1e42680..ebeb9c6d4 100644 --- a/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml +++ b/applets/systemmonitor/common/contents/ui/ConfigGeneral.qml @@ -131,7 +131,7 @@ Item { } textFromValue: function(value) { var seconds = value / 1000 - return i18nc("SpinBox text", "%1 seconds", seconds.toFixed(1)) + return i18ncp("SpinBox text", "%1 second", "%1 seconds", seconds.toFixed(1)) } valueFromText: function(text) { return parseFloat(text) * 1000 diff --git a/applets/systemmonitor/cpu/Messages.sh b/applets/systemmonitor/cpu/Messages.sh index 8465c44e9..45b82b4cf 100644 --- a/applets/systemmonitor/cpu/Messages.sh +++ b/applets/systemmonitor/cpu/Messages.sh @@ -1,2 +1,2 @@ #! /usr/bin/env bash -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.cpu.pot +$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` `find ../common -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.cpu.pot diff --git a/applets/systemmonitor/diskactivity/Messages.sh b/applets/systemmonitor/diskactivity/Messages.sh index 9ced56495..17260f35e 100644 --- a/applets/systemmonitor/diskactivity/Messages.sh +++ b/applets/systemmonitor/diskactivity/Messages.sh @@ -1,2 +1,2 @@ #! /usr/bin/env bash -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.diskactivity.pot +$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` `find ../common -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.diskactivity.pot diff --git a/applets/systemmonitor/diskusage/Messages.sh b/applets/systemmonitor/diskusage/Messages.sh index dc855f477..26ffe5ac4 100644 --- a/applets/systemmonitor/diskusage/Messages.sh +++ b/applets/systemmonitor/diskusage/Messages.sh @@ -1,2 +1,2 @@ #! /usr/bin/env bash -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.diskusage.pot +$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` `find ../common -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.diskusage.pot diff --git a/applets/systemmonitor/memory/Messages.sh b/applets/systemmonitor/memory/Messages.sh index 8b96343d2..0d542a921 100644 --- a/applets/systemmonitor/memory/Messages.sh +++ b/applets/systemmonitor/memory/Messages.sh @@ -1,2 +1,2 @@ #! /usr/bin/env bash -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.memory.pot +$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` `find ../common -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.memory.pot diff --git a/applets/systemmonitor/net/Messages.sh b/applets/systemmonitor/net/Messages.sh index 2382ed69d..8523a0e03 100644 --- a/applets/systemmonitor/net/Messages.sh +++ b/applets/systemmonitor/net/Messages.sh @@ -1,2 +1,2 @@ #! /usr/bin/env bash -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.net.pot +$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` `find ../common -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.systemmonitor.net.pot