Skip to content

Commit f1b56df

Browse files
committed
Fix #17 by adding translations template, Bump version to 7.0
1 parent d16d050 commit f1b56df

File tree

7 files changed

+304
-83
lines changed

7 files changed

+304
-83
lines changed

contents/ui/ConfigGeneral.qml

Lines changed: 10 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ Kirigami.FormLayout {
4141
property string cfg_customButtonImage: plasmoid.configuration.customButtonImage
4242

4343
property alias cfg_appNameFormat: appNameFormat.currentIndex
44-
property alias cfg_recentOrdering: recentOrdering.currentIndex
45-
property alias cfg_showRecentApps: showRecentApps.checked
46-
property alias cfg_showRecentDocs: showRecentDocs.checked
47-
property alias cfg_showRecentContacts: showRecentContacts.checked
4844

4945
property alias cfg_menuPosition: menuPosition.currentIndex
5046
property alias cfg_favGridModel: favGridModel.currentIndex
@@ -190,9 +186,9 @@ Kirigami.FormLayout {
190186
ComboBox {
191187
id: favGridModel
192188

193-
Kirigami.FormData.label: i18n("Pinned items:")
189+
Kirigami.FormData.label: i18n("Pinned item:")
194190

195-
model: [i18n("Favourite apps"), i18n("Recent apps"), i18n("Recent Documents")]
191+
model: [i18n("Favourite apps"), i18n("Recent apps"), i18n("Recent documents")]
196192
}
197193

198194
Item {
@@ -202,7 +198,7 @@ Kirigami.FormLayout {
202198
ComboBox {
203199
id: recentGridModel
204200

205-
Kirigami.FormData.label: i18n("Recommended items:")
201+
Kirigami.FormData.label: i18n("Recommended item:")
206202

207203
model: [i18n("Recent Documents"), i18n("Recent apps"), i18n("Favourite apps"), i18n("None")]
208204
}
@@ -236,7 +232,7 @@ Kirigami.FormLayout {
236232
CheckBox {
237233
id: defaultAllApps
238234
Kirigami.FormData.label: i18n("Panel Properties:")
239-
text: i18n("Show All Apps By Default")
235+
text: i18n("Show All apps by default")
240236
}
241237

242238
CheckBox {
@@ -251,7 +247,7 @@ Kirigami.FormLayout {
251247

252248
CheckBox {
253249
id: reducePinnedSize
254-
text: i18n("Reduce Icon Size for Pinned Items")
250+
text: i18n("Reduce Icon Size for Pinned item")
255251
}
256252

257253
CheckBox {
@@ -261,7 +257,7 @@ Kirigami.FormLayout {
261257

262258
CheckBox {
263259
id: showDescription
264-
text: i18n("Show Description for all apps and search items")
260+
text: i18n("Show Description for all apps and search item")
265261
}
266262

267263
CheckBox {
@@ -313,60 +309,22 @@ Kirigami.FormLayout {
313309

314310
CheckBox {
315311
id: downIconsFileManager
316-
text: i18n("File Manager")
312+
text: i18n("File manager")
317313
}
318314

319315
CheckBox {
320316
id: downIconsSystemSettings
321-
text: i18n("System Settings")
317+
text: i18n("System settings")
322318
}
323319

324320
CheckBox {
325321
id: downIconsLock
326-
text: i18n("Lock")
322+
text: i18n("Lock screen")
327323
}
328324

329325
CheckBox {
330326
id: downIconsPowerOptions
331-
text: i18n("Power Options")
332-
}
333-
334-
Item {
335-
visible: false
336-
Kirigami.FormData.isSection: true
337-
}
338-
339-
CheckBox {
340-
id: showRecentApps
341-
342-
Kirigami.FormData.label: i18n("Show categories:")
343-
visible: false
344-
text: recentOrdering.currentIndex == 0
345-
? i18n("Recent applications")
346-
: i18n("Often used applications")
347-
}
348-
349-
CheckBox {
350-
id: showRecentDocs
351-
visible: false
352-
text: recentOrdering.currentIndex == 0
353-
? i18n("Recent documents")
354-
: i18n("Often used documents")
355-
}
356-
357-
CheckBox {
358-
id: showRecentContacts
359-
visible: false
360-
text: recentOrdering.currentIndex == 0
361-
? i18n("Recent contacts")
362-
: i18n("Often used contacts")
363-
}
364-
365-
ComboBox {
366-
id: recentOrdering
367-
visible: false
368-
Kirigami.FormData.label: i18n("Sort items in categories by:")
369-
model: [i18nc("@item:inlistbox Sort items in categories by [Recently used | Often used]", "Recently used"), i18nc("@item:inlistbox Sort items in categories by [Recently used | Ofetn used]", "Often used")]
327+
text: i18n("Power options")
370328
}
371329

372330
Item {

contents/ui/Footer.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Control {
3737
property Item configureButton: configureButton
3838
property Item avatar: avatarButton
3939
property int iconSize: units.iconSizes.smallMedium
40-
property var footerNames: ["Documents", "Pictures", "Music", "Download", "Videos", "File Manager", "System settings", "Lock screen", "Leave..."]
40+
property var footerNames: ["Documents", "Pictures", "Music", "Downloads", "Videos", "File manager", "System settings", "Lock screen", "Power options"]
4141
property var footerIcons: ["folder-documents-symbolic", "folder-pictures-symbolic", "folder-music-symbolic", "folder-download-symbolic", "folder-videos-symbolic", Qt.resolvedUrl((theme.textColor.r * 0.299 + theme.textColor.g * 0.587 + theme.textColor.b * 0.114) > 0.7265625 ? "icons/explorer.svg" : "icons/explorer_dark.svg"), "configure", "system-lock-screen", "system-shutdown"]
4242

4343
background: Rectangle {
@@ -219,7 +219,7 @@ Control {
219219
}
220220
onHoveredChanged: hovered ? animateOpacity.start() : animateOpacityReverse.start();
221221
PlasmaComponents.ToolTip {
222-
text: i18nc("@action", footerNames[index])
222+
text: i18n(footerNames[index])
223223
}
224224
MouseArea {
225225
onClicked: index < 6 ? executable.exec("xdg-open $(xdg-user-dir" + (index < 5 ? (" " + footerNames[index].toUpperCase()) : "") + ")") : index == 6 ? logic.openUrl("file:///usr/share/applications/systemsettings.desktop") : pmEngine.performOperation(index == 8 ? "requestShutDown" : "lockScreen")

metadata.desktop

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ X-Plasma-Provides=org.kde.plasma.launchermenu
1313
X-KDE-PluginInfo-Author=Prateek SU
1414
X-KDE-PluginInfo-Email=pankajsunal123@gmail.com
1515
X-KDE-PluginInfo-Name=menu11
16-
X-KDE-PluginInfo-Version=6.5
16+
X-KDE-PluginInfo-Version=7.0
17+
X-KDE-PluginInfo-Website=https://github.com/prateekmedia/Menu11
18+
X-KDE-PluginInfo-KdeStoreId=1544959
1719
X-KDE-PluginInfo-Category=Application Launchers
18-
X-KDE-PluginInfo-Depends=
1920
X-KDE-PluginInfo-License=GPL-2.0+
2021
X-KDE-PluginInfo-EnabledByDefault=true

metadata.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

translate/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
> Version 7 of Zren's i18n scripts.
2+
3+
With KDE Frameworks v5.37 and above, translations are bundled with the `*.plasmoid` file downloaded from the store.
4+
5+
## Install Translations
6+
7+
Go to `~/.local/share/plasma/plasmoids/menu11/translate/` and run `sh ./build --restartplasma`.
8+
9+
## New Translations
10+
11+
1. Fill out [`template.pot`](template.pot) with your translations then open a [new issue](https://github.com/prateekmedia/menu11/issues/new), name the file `spanish.txt`, attach the txt file to the issue (drag and drop).
12+
13+
Or if you know how to make a pull request
14+
15+
1. Copy the `template.pot` file and name it your locale's code (Eg: `en`/`de`/`fr`) with the extension `.po`. Then fill out all the `msgstr ""`.
16+
17+
## Scripts
18+
19+
* `sh ./merge` will parse the `i18n()` calls in the `*.qml` files and write it to the `template.pot` file. Then it will merge any changes into the `*.po` language files.
20+
* `sh ./build` will convert the `*.po` files to it's binary `*.mo` version and move it to `contents/locale/...` which will bundle the translations in the `*.plasmoid` without needing the user to manually install them.
21+
* `sh ./plasmoidlocaletest` will run `./build` then `plasmoidviewer` (part of `plasma-sdk`).
22+
23+
## Links
24+
25+
* https://zren.github.io/kde/docs/widget/#translations-i18n
26+
* https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems
27+
* https://api.kde.org/frameworks/ki18n/html/prg_guide.html
28+
29+
## Examples
30+
31+
* https://l10n.kde.org/stats/gui/trunk-kf5/team/fr/plasma-desktop/
32+
* https://github.com/psifidotos/nowdock-plasmoid/tree/master/po
33+
* https://github.com/kotelnik/plasma-applet-redshift-control/tree/master/translations
34+
35+
## Status
36+
| Locale | Lines | % Done|
37+
|----------|---------|-------|
38+
| Template | 45 | |

translate/build

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/bin/sh
2+
# Version: 5
3+
4+
# This script will convert the *.po files to *.mo files, rebuilding the package/contents/locale folder.
5+
# Feature discussion: https://phabricator.kde.org/D5209
6+
# Eg: contents/locale/fr_CA/LC_MESSAGES/plasma_applet_org.kde.plasma.eventcalendar.mo
7+
8+
DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd`
9+
plasmoidName=`kreadconfig5 --file="$DIR/../metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Name"`
10+
website=`kreadconfig5 --file="$DIR/../metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Website"`
11+
bugAddress="$website"
12+
packageRoot=".." # Root of translatable sources
13+
projectName="plasma_applet_${plasmoidName}" # project name
14+
15+
#---
16+
if [ -z "$plasmoidName" ]; then
17+
echo "[build] Error: Couldn't read plasmoidName."
18+
exit
19+
fi
20+
21+
if [ -z "$(which msgfmt)" ]; then
22+
echo "[build] Error: msgfmt command not found. Need to install gettext"
23+
echo "[build] Running 'sudo apt install gettext'"
24+
sudo apt install gettext
25+
echo "[build] gettext installation should be finished. Going back to installing translations."
26+
fi
27+
28+
#---
29+
echo "[build] Compiling messages"
30+
31+
catalogs=`find . -name '*.po'`
32+
for cat in $catalogs; do
33+
echo "$cat"
34+
catLocale=`basename ${cat%.*}`
35+
msgfmt -o "${catLocale}.mo" "$cat"
36+
37+
installPath="$DIR/../contents/locale/${catLocale}/LC_MESSAGES/${projectName}.mo"
38+
39+
echo "[build] Install to ${installPath}"
40+
mkdir -p "$(dirname "$installPath")"
41+
mv "${catLocale}.mo" "${installPath}"
42+
done
43+
44+
echo "[build] Done building messages"
45+
46+
if [ "$1" = "--restartplasma" ]; then
47+
echo "[build] Restarting plasmashell"
48+
killall plasmashell
49+
kstart5 plasmashell
50+
echo "[build] Done restarting plasmashell"
51+
else
52+
echo "[build] (re)install the plasmoid and restart plasmashell to test."
53+
fi

0 commit comments

Comments
 (0)