diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100755 index 77389e0..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,15 +0,0 @@ -# These are supported funding model platforms - -#github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] - -#patreon: # Replace with a single Patreon username -#open_collective: # Replace with a single Open Collective username -#ko_fi: # Replace with a single Ko-fi username -#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -#liberapay: # Replace with a single Liberapay username -#issuehunt: # Replace with a single IssueHunt username -#otechie: # Replace with a single Otechie username -#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] -#github: [Valeria-Fadeeva] -custom: ["https://www.tinkoff.ru/rm/fadeeva.valeriya96/9bLRi79066", "https://yoomoney.ru/to/4100115921160758", "https://qiwi.com/n/VALERIAFADEEVA", "valeria.fadeeva.me"] diff --git a/com.github.adhec.OnzeMenuKDE/contents/config/main.xml b/com.github.adhec.OnzeMenuKDE/contents/config/main.xml index c387940..7949a17 100644 --- a/com.github.adhec.OnzeMenuKDE/contents/config/main.xml +++ b/com.github.adhec.OnzeMenuKDE/contents/config/main.xml @@ -24,16 +24,16 @@ true - 0 + 2 false - 6 + 7 - 3 + 4 12 @@ -42,7 +42,7 @@ Medium - preferred://browser,kontact.desktop,systemsettings.desktop,org.kde.dolphin.desktop,ktp-contactlist.desktop,org.kde.kate.desktop + org.kde.dolphin.desktop,systemsettings.desktop,org.manjaro.pamac.manager.desktop,ar.com.softwareperonista.Pace.desktop,melawy-welcome.desktop,firefoxdeveloperedition.desktop,firefox.desktop,org.kde.kate.desktop,skypeforlinux.desktop,org.telegram.desktop.desktop,discord.desktop,Zoom.desktop,brave-browser.desktop,google-chrome.desktop,gimp.desktop,org.inkscape.Inkscape.desktop,com.obsproject.Studio.desktop,code.desktop,org.kde.kleopatra.desktop,org.kde.konsole.desktop,org.kde.kcalc.desktop,blender.desktop,gparted.desktop,org.kde.partitionmanager.desktop,org.kde.kinfocenter.desktop logout,lock-screen,reboot,shutdown @@ -63,7 +63,7 @@ true - bookmarks,baloosearch + logout,lock-screen,reboot,shutdown true diff --git a/com.github.adhec.OnzeMenuKDE/translate/ReadMe.md b/com.github.adhec.OnzeMenuKDE/translate/ReadMe.md index 11350b3..a7b6196 100644 --- a/com.github.adhec.OnzeMenuKDE/translate/ReadMe.md +++ b/com.github.adhec.OnzeMenuKDE/translate/ReadMe.md @@ -1,13 +1,14 @@ -> Zren based translation template, i18n scripts. [link](https://github.com/Zren/plasma-applet-tiledmenu) +> Version 7 of Zren's i18n scripts. [link](https://github.com/Zren/plasma-applet-tiledmenu) +With KDE Frameworks v5.37 and above, translations are bundled with the `*.plasmoid` file downloaded from the store. ## Install Translations -Go to `~/.local/share/plasma/plasmoids/OnzeMenu/translate/` and run `sh ./build --restartplasma`. +Go to `~/.local/share/plasma/plasmoids/com.github.adhec.OnzeMenuKDE/translate/` and run `sh ./build --restartplasma`. ## New Translations -1. Fill out [`template.pot`](template.pot) with your translations then open a [new issue](https://github.com/adhec/dittoMenuKDE/issues), name the file `spanish.txt`, attach the txt file to the issue (drag and drop). +1. Fill out [`template.pot`](template.pot) with your translations then open a [new issue](https://github.com/adhec/OnzeMenuKDE/issues/new), name the file `spanish.txt`, attach the txt file to the issue (drag and drop). Or if you know how to make a pull request @@ -34,13 +35,13 @@ Or if you know how to make a pull request ## Status | Locale | Lines | % Done| |----------|---------|-------| -| Template | 40 | | -| de | 32/40 | 80% | -| fr | 32/40 | 80% | -| ko | 32/40 | 80% | -| nl | 33/40 | 82% | -| pt-br | 32/40 | 80% | -| ru | 32/40 | 80% | -| tr | 28/40 | 70% | -| uk | 33/40 | 82% | -| zh_CN | 30/40 | 75% | +| Template | 42 | | +| de | 30/42 | 71% | +| fr | 30/42 | 71% | +| ko | 30/42 | 71% | +| nl | 31/42 | 73% | +| pt-br | 30/42 | 71% | +| ru | 31/42 | 73% | +| tr | 26/42 | 61% | +| uk | 31/42 | 73% | +| zh_CN | 29/42 | 69% | diff --git a/com.github.adhec.OnzeMenuKDE/translate/build b/com.github.adhec.OnzeMenuKDE/translate/build new file mode 100755 index 0000000..f2cdacd --- /dev/null +++ b/com.github.adhec.OnzeMenuKDE/translate/build @@ -0,0 +1,54 @@ +#!/bin/bash +# Version: 6 + +# This script will convert the *.po files to *.mo files, rebuilding the package/contents/locale folder. +# Feature discussion: https://phabricator.kde.org/D5209 +# Eg: contents/locale/fr_CA/LC_MESSAGES/plasma_applet_org.kde.plasma.eventcalendar.mo + +DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd` +plasmoidName=com.github.adhec.OnzeMenuKDE +widgetName="${plasmoidName##*.}" # Strip namespace +website=https://github.com/adhec/OnzeMenuKDE +bugAddress="$website" +packageRoot=".." # Root of translatable sources +projectName="plasma_applet_${plasmoidName}" # project name + +#--- +if [ -z "$plasmoidName" ]; then + echo "[build] Error: Couldn't read plasmoidName." + exit +fi + +if [ -z "$(which msgfmt)" ]; then + echo "[build] Error: msgfmt command not found. Need to install gettext" + echo "[build] Running 'sudo apt install gettext'" + sudo apt install gettext + echo "[build] gettext installation should be finished. Going back to installing translations." +fi + +#--- +echo "[build] Compiling messages" + +catalogs=`find . -name '*.po' | sort` +for cat in $catalogs; do + echo "$cat" + catLocale=`basename ${cat%.*}` + msgfmt -o "${catLocale}.mo" "$cat" + + installPath="$DIR/../contents/locale/${catLocale}/LC_MESSAGES/${projectName}.mo" + + echo "[build] Install to ${installPath}" + mkdir -p "$(dirname "$installPath")" + mv "${catLocale}.mo" "${installPath}" +done + +echo "[build] Done building messages" + +if [ "$1" = "--restartplasma" ]; then + echo "[build] Restarting plasmashell" + killall plasmashell + kstart5 plasmashell + echo "[build] Done restarting plasmashell" +else + echo "[build] (re)install the plasmoid and restart plasmashell to test." +fi diff --git a/com.github.adhec.OnzeMenuKDE/translate/de.po b/com.github.adhec.OnzeMenuKDE/translate/de.po index a6616ae..74336d0 100644 --- a/com.github.adhec.OnzeMenuKDE/translate/de.po +++ b/com.github.adhec.OnzeMenuKDE/translate/de.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OnzeMenu\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:33-0300\n" +"Report-Msgid-Bugs-To: https://github.com/adhec/OnzeMenuKDE\n" +"POT-Creation-Date: 2024-01-03 17:40+0500\n" "PO-Revision-Date: 2022-11-06 15:+0200\n" "Last-Translator: Pascal Dietrich \n" "Language-Team: \n" @@ -16,14 +16,6 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../metadata.desktop -msgid "OnzeMenu 11" -msgstr "OnzeMenu 11" - -#: ../metadata.desktop -msgid "A configurable launcher menu 11" -msgstr "Ein konfigurierbares Launcher-Menü 11" - #: ../contents/config/config.qml msgid "General" msgstr "Allgemein" @@ -62,6 +54,25 @@ msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Symbol entfernen" +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@label:textbox" +msgid "Text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@info:placeholder" +msgid "Type here to add a text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@action:button" +msgid "Reset menu label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Text label fontsize" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Menu position" msgstr "Position des Menüs" @@ -177,3 +188,9 @@ msgstr "Zurück" #: ../contents/ui/MenuRepresentation.qml msgid "More" msgstr "Mehr" + +#~ msgid "OnzeMenu 11" +#~ msgstr "OnzeMenu 11" + +#~ msgid "A configurable launcher menu 11" +#~ msgstr "Ein konfigurierbares Launcher-Menü 11" diff --git a/com.github.adhec.OnzeMenuKDE/translate/fr.po b/com.github.adhec.OnzeMenuKDE/translate/fr.po index b0c8276..9e009a6 100644 --- a/com.github.adhec.OnzeMenuKDE/translate/fr.po +++ b/com.github.adhec.OnzeMenuKDE/translate/fr.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: OnzeMenu\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:33-0300\n" +"Report-Msgid-Bugs-To: https://github.com/adhec/OnzeMenuKDE\n" +"POT-Creation-Date: 2024-01-03 17:40+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,14 +17,6 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../metadata.desktop -msgid "OnzeMenu 11" -msgstr "OnzeMenu 11" - -#: ../metadata.desktop -msgid "A configurable launcher menu 11" -msgstr "Un lanceur configurable style Win11" - #: ../contents/config/config.qml msgid "General" msgstr "Général" @@ -63,6 +55,25 @@ msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Effacer l'icône" +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@label:textbox" +msgid "Text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@info:placeholder" +msgid "Type here to add a text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@action:button" +msgid "Reset menu label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Text label fontsize" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Menu position" msgstr "Position du menu" @@ -178,3 +189,9 @@ msgstr "Retour" #: ../contents/ui/MenuRepresentation.qml msgid "More" msgstr "Plus" + +#~ msgid "OnzeMenu 11" +#~ msgstr "OnzeMenu 11" + +#~ msgid "A configurable launcher menu 11" +#~ msgstr "Un lanceur configurable style Win11" diff --git a/com.github.adhec.OnzeMenuKDE/translate/ko.po b/com.github.adhec.OnzeMenuKDE/translate/ko.po index d91a9d1..be13a18 100644 --- a/com.github.adhec.OnzeMenuKDE/translate/ko.po +++ b/com.github.adhec.OnzeMenuKDE/translate/ko.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OnzeMenu\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:33-0300\n" +"Report-Msgid-Bugs-To: https://github.com/adhec/OnzeMenuKDE\n" +"POT-Creation-Date: 2024-01-03 17:40+0500\n" "PO-Revision-Date: 2022-06-22 14:28+0900\n" "Last-Translator: \n" "Language-Team: \n" @@ -18,14 +18,6 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 3.0.1\n" -#: ../metadata.desktop -msgid "OnzeMenu 11" -msgstr "Onze 메뉴 11" - -#: ../metadata.desktop -msgid "A configurable launcher menu 11" -msgstr "설정 가능한 Win11 스타일 프로그램 실행기" - #: ../contents/config/config.qml msgid "General" msgstr "일반" @@ -64,6 +56,25 @@ msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "아이콘 초기화" +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@label:textbox" +msgid "Text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@info:placeholder" +msgid "Type here to add a text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@action:button" +msgid "Reset menu label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Text label fontsize" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Menu position" msgstr "메뉴 위치" @@ -179,3 +190,9 @@ msgstr "뒤로" #: ../contents/ui/MenuRepresentation.qml msgid "More" msgstr "더 보기" + +#~ msgid "OnzeMenu 11" +#~ msgstr "Onze 메뉴 11" + +#~ msgid "A configurable launcher menu 11" +#~ msgstr "설정 가능한 Win11 스타일 프로그램 실행기" diff --git a/com.github.adhec.OnzeMenuKDE/translate/merge.sh b/com.github.adhec.OnzeMenuKDE/translate/merge similarity index 71% rename from com.github.adhec.OnzeMenuKDE/translate/merge.sh rename to com.github.adhec.OnzeMenuKDE/translate/merge index 1e6a239..a1844f0 100755 --- a/com.github.adhec.OnzeMenuKDE/translate/merge.sh +++ b/com.github.adhec.OnzeMenuKDE/translate/merge @@ -1,14 +1,14 @@ -#!/bin/sh -# Version: 20 +#!/bin/bash +# Version: 22 # https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems # https://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems/Outside_KDE_repositories # https://invent.kde.org/sysadmin/l10n-scripty/-/blob/master/extract-messages.sh DIR=`cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd` -plasmoidName=`kreadconfig5 --file="$DIR/../metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Name"` +plasmoidName=com.github.adhec.OnzeMenuKDE widgetName="${plasmoidName##*.}" # Strip namespace -website=`kreadconfig5 --file="$DIR/../metadata.desktop" --group="Desktop Entry" --key="X-KDE-PluginInfo-Website"` +website=https://github.com/adhec/OnzeMenuKDE bugAddress="$website" packageRoot=".." # Root of translatable sources projectName="plasma_applet_${plasmoidName}" # project name @@ -30,19 +30,6 @@ fi echo "[merge] Extracting messages" potArgs="--from-code=UTF-8 --width=200 --add-location=file" -find "${packageRoot}" -name '*.desktop' | sort > "${DIR}/infiles.list" -xgettext \ - ${potArgs} \ - --files-from="${DIR}/infiles.list" \ - --language=Desktop \ - -D "${packageRoot}" \ - -D "${DIR}" \ - -o "template.pot.new" \ - || \ - { echo "[merge] error while calling xgettext. aborting."; exit 1; } - -sed -i 's/"Content-Type: text\/plain; charset=CHARSET\\n"/"Content-Type: text\/plain; charset=UTF-8\\n"/' "template.pot.new" - # See Ki18n's extract-messages.sh for a full example: # https://invent.kde.org/sysadmin/l10n-scripty/-/blob/master/extract-messages.sh#L25 # The -kN_ and -kaliasLocale keywords are mentioned in the Outside_KDE_repositories wiki. @@ -68,11 +55,11 @@ xgettext \ --msgid-bugs-address="${bugAddress}" \ -D "${packageRoot}" \ -D "${DIR}" \ - --join-existing \ -o "template.pot.new" \ || \ { echo "[merge] error while calling xgettext. aborting."; exit 1; } +sed -i 's/"Content-Type: text\/plain; charset=CHARSET\\n"/"Content-Type: text\/plain; charset=UTF-8\\n"/' "template.pot.new" sed -i 's/# SOME DESCRIPTIVE TITLE./'"# Translation of ${widgetName} in LANGUAGE"'/' "template.pot.new" sed -i 's/# Copyright (C) YEAR THE PACKAGE'"'"'S COPYRIGHT HOLDER/'"# Copyright (C) $(date +%Y)"'/' "template.pot.new" @@ -128,6 +115,16 @@ for cat in $catalogs; do widthArg="--width=400" fi + compendiumArg="" + if [ ! -z "$COMPENDIUM_DIR" ]; then + langCode=`basename "${cat%.*}"` + compendiumPath=`realpath "$COMPENDIUM_DIR/compendium-${langCode}.po"` + if [ -f "$compendiumPath" ]; then + echo "compendiumPath=$compendiumPath" + compendiumArg="--compendium=$compendiumPath" + fi + fi + cp "$cat" "$cat.new" sed -i 's/"Content-Type: text\/plain; charset=CHARSET\\n"/"Content-Type: text\/plain; charset=UTF-8\\n"/' "$cat.new" @@ -135,6 +132,7 @@ for cat in $catalogs; do ${widthArg} \ --add-location=file \ --no-fuzzy-matching \ + ${compendiumArg} \ -o "$cat.new" \ "$cat.new" "${DIR}/template.pot" @@ -153,62 +151,6 @@ for cat in $catalogs; do done echo "[merge] Done merging messages" -#--- -echo "[merge] Updating .desktop file" - -# Generate LINGUAS for msgfmt -if [ -f "$DIR/LINGUAS" ]; then - rm "$DIR/LINGUAS" -fi -touch "$DIR/LINGUAS" -for cat in $catalogs; do - catLocale=`basename ${cat%.*}` - echo "${catLocale}" >> "$DIR/LINGUAS" -done - -cp -f "$DIR/../metadata.desktop" "$DIR/template.desktop" -sed -i '/^Name\[/ d; /^GenericName\[/ d; /^Comment\[/ d; /^Keywords\[/ d' "$DIR/template.desktop" - -msgfmt \ - --desktop \ - --template="$DIR/template.desktop" \ - -d "$DIR/" \ - -o "$DIR/new.desktop" - -# Delete empty msgid messages that used the po header -if [ ! -z "$(grep '^Name=$' "$DIR/new.desktop")" ]; then - echo "[merge] Name in metadata.desktop is empty!" - sed -i '/^Name\[/ d' "$DIR/new.desktop" -fi -if [ ! -z "$(grep '^GenericName=$' "$DIR/new.desktop")" ]; then - echo "[merge] GenericName in metadata.desktop is empty!" - sed -i '/^GenericName\[/ d' "$DIR/new.desktop" -fi -if [ ! -z "$(grep '^Comment=$' "$DIR/new.desktop")" ]; then - echo "[merge] Comment in metadata.desktop is empty!" - sed -i '/^Comment\[/ d' "$DIR/new.desktop" -fi -if [ ! -z "$(grep '^Keywords=$' "$DIR/new.desktop")" ]; then - echo "[merge] Keywords in metadata.desktop is empty!" - sed -i '/^Keywords\[/ d' "$DIR/new.desktop" -fi - -# Place translations at the bottom of the desktop file. -translatedLines=`cat "$DIR/new.desktop" | grep "]="` -if [ ! -z "${translatedLines}" ]; then - sed -i '/^Name\[/ d; /^GenericName\[/ d; /^Comment\[/ d; /^Keywords\[/ d' "$DIR/new.desktop" - if [ "$(tail -c 2 "$DIR/new.desktop" | wc -l)" != "2" ]; then - # Does not end with 2 empty lines, so add an empty line. - echo "" >> "$DIR/new.desktop" - fi - echo "${translatedLines}" >> "$DIR/new.desktop" -fi - -# Cleanup -mv "$DIR/new.desktop" "$DIR/../metadata.desktop" -rm "$DIR/template.desktop" -rm "$DIR/LINGUAS" - #--- # Populate ReadMe.md echo "[merge] Updating translate/ReadMe.md" diff --git a/com.github.adhec.OnzeMenuKDE/translate/nl.po b/com.github.adhec.OnzeMenuKDE/translate/nl.po index 188eeed..0c23387 100644 --- a/com.github.adhec.OnzeMenuKDE/translate/nl.po +++ b/com.github.adhec.OnzeMenuKDE/translate/nl.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OnzeMenu\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:33-0300\n" +"Report-Msgid-Bugs-To: https://github.com/adhec/OnzeMenuKDE\n" +"POT-Creation-Date: 2024-01-03 17:40+0500\n" "PO-Revision-Date: 2023-04-03 11:01+0200\n" "Last-Translator: Heimen Stoffels \n" "Language-Team: \n" @@ -18,14 +18,6 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 3.2.2\n" -#: ../metadata.desktop -msgid "OnzeMenu 11" -msgstr "OnzeMenu 11" - -#: ../metadata.desktop -msgid "A configurable launcher menu 11" -msgstr "Instelbare programmastarter 11" - #: ../contents/config/config.qml msgid "General" msgstr "Algemeen" @@ -64,6 +56,25 @@ msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Pictogram verwijderen" +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@label:textbox" +msgid "Text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@info:placeholder" +msgid "Type here to add a text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@action:button" +msgid "Reset menu label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Text label fontsize" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Menu position" msgstr "Menulocatie" @@ -180,6 +191,12 @@ msgstr "Terug" msgid "More" msgstr "Meer" +#~ msgid "OnzeMenu 11" +#~ msgstr "OnzeMenu 11" + +#~ msgid "A configurable launcher menu 11" +#~ msgstr "Instelbare programmastarter 11" + #~ msgid "Menu position:" #~ msgstr "Menulocatie:" diff --git a/com.github.adhec.OnzeMenuKDE/translate/plasmoidlocaletest b/com.github.adhec.OnzeMenuKDE/translate/plasmoidlocaletest new file mode 100755 index 0000000..dacdedb --- /dev/null +++ b/com.github.adhec.OnzeMenuKDE/translate/plasmoidlocaletest @@ -0,0 +1,181 @@ +#!/bin/bash +# Version 9 +# Requires plasmoidviewer v5.13.0 + +function checkIfLangInstalled { + if [ -x "$(command -v dpkg)" ]; then + dpkg -l ${1} >/dev/null 2>&1 || ( \ + echo -e "${1} not installed.\nInstalling now before continuing.\n" \ + ; sudo apt install ${1} \ + ) || ( \ + echo -e "\nError trying to install ${1}\nPlease run 'sudo apt install ${1}'\n" \ + ; exit 1 \ + ) + elif [ -x "$(command -v pacman)" ]; then + # TODO: run `locale -a` and check if the locale is enabled. + if false; then + # https://wiki.archlinux.org/index.php/Locale + # Uncomment the locale in /etc/locale.gen + # Then run `locale-gen` + echo -e "\nPlease install this locale in System Settings first.\n" + exit 1 + else + echo "" + fi + else + echo -e "\nPackage manager not recognized. If the widget is not translated, please install the package '${1}'\n" + fi +} + +langInput="${1}" +lang="" +languagePack="" + +if [[ "$langInput" =~ ":" ]]; then # String contains a colon so assume it's a locale code. + lang="${langInput}" + IFS=: read -r l1 l2 <<< "${lang}" + languagePack="language-pack-${l2}" +fi + +# https://stackoverflow.com/questions/3191664/list-of-all-locales-and-their-short-codes/28357857#28357857 +declare -a langArr=( + "af_ZA:af:Afrikaans (South Africa)" + "ak_GH:ak:Akan (Ghana)" + "am_ET:am:Amharic (Ethiopia)" + "ar_EG:ar:Arabic (Egypt)" + "as_IN:as:Assamese (India)" + "az_AZ:az:Azerbaijani (Azerbaijan)" + "be_BY:be:Belarusian (Belarus)" + "bem_ZM:bem:Bemba (Zambia)" + "bg_BG:bg:Bulgarian (Bulgaria)" + "bo_IN:bo:Tibetan (India)" + "bs_BA:bs:Bosnian (Bosnia and Herzegovina)" + "ca_ES:ca:Catalan (Spain)" + "chr_US:ch:Cherokee (United States)" + "cs_CZ:cs:Czech (Czech Republic)" + "cy_GB:cy:Welsh (United Kingdom)" + "da_DK:da:Danish (Denmark)" + "de_DE:de:German (Germany)" + "el_GR:el:Greek (Greece)" + "es_MX:es:Spanish (Mexico)" + "et_EE:et:Estonian (Estonia)" + "eu_ES:eu:Basque (Spain)" + "fa_IR:fa:Persian (Iran)" + "ff_SN:ff:Fulah (Senegal)" + "fi_FI:fi:Finnish (Finland)" + "fo_FO:fo:Faroese (Faroe Islands)" + "fr_CA:fr:French (Canada)" + "ga_IE:ga:Irish (Ireland)" + "gl_ES:gl:Galician (Spain)" + "gu_IN:gu:Gujarati (India)" + "gv_GB:gv:Manx (United Kingdom)" + "ha_NG:ha:Hausa (Nigeria)" + "he_IL:he:Hebrew (Israel)" + "hi_IN:hi:Hindi (India)" + "hr_HR:hr:Croatian (Croatia)" + "hu_HU:hu:Hungarian (Hungary)" + "hy_AM:hy:Armenian (Armenia)" + "id_ID:id:Indonesian (Indonesia)" + "ig_NG:ig:Igbo (Nigeria)" + "is_IS:is:Icelandic (Iceland)" + "it_IT:it:Italian (Italy)" + "ja_JP:ja:Japanese (Japan)" + "ka_GE:ka:Georgian (Georgia)" + "kk_KZ:kk:Kazakh (Kazakhstan)" + "kl_GL:kl:Kalaallisut (Greenland)" + "km_KH:km:Khmer (Cambodia)" + "kn_IN:kn:Kannada (India)" + "ko_KR:ko:Korean (South Korea)" + "ko_KR:ko:Korean (South Korea)" + "lg_UG:lg:Ganda (Uganda)" + "lt_LT:lt:Lithuanian (Lithuania)" + "lv_LV:lv:Latvian (Latvia)" + "mg_MG:mg:Malagasy (Madagascar)" + "mk_MK:mk:Macedonian (Macedonia)" + "ml_IN:ml:Malayalam (India)" + "mr_IN:mr:Marathi (India)" + "ms_MY:ms:Malay (Malaysia)" + "mt_MT:mt:Maltese (Malta)" + "my_MM:my:Burmese (Myanmar [Burma])" + "nb_NO:nb:Norwegian Bokmål (Norway)" + "ne_NP:ne:Nepali (Nepal)" + "nl_NL:nl:Dutch (Netherlands)" + "nn_NO:nn:Norwegian Nynorsk (Norway)" + "om_ET:om:Oromo (Ethiopia)" + "or_IN:or:Oriya (India)" + "pa_PK:pa:Punjabi (Pakistan)" + "pl_PL:pl:Polish (Poland)" + "ps_AF:ps:Pashto (Afghanistan)" + "pt_BR:pt:Portuguese (Brazil)" + "ro_RO:ro:Romanian (Romania)" + "ru_RU:ru:Russian (Russia)" + "rw_RW:rw:Kinyarwanda (Rwanda)" + "si_LK:si:Sinhala (Sri Lanka)" + "sk_SK:sk:Slovak (Slovakia)" + "sl_SI:sl:Slovenian (Slovenia)" + "so_SO:so:Somali (Somalia)" + "sq_AL:sq:Albanian (Albania)" + "sr_RS:sr:Serbian (Serbia)" + "sv_SE:sv:Swedish (Sweden)" + "sw_KE:sw:Swahili (Kenya)" + "ta_IN:ta:Tamil (India)" + "te_IN:te:Telugu (India)" + "th_TH:th:Thai (Thailand)" + "ti_ER:ti:Tigrinya (Eritrea)" + "to_TO:to:Tonga (Tonga)" + "tr_TR:tr:Turkish (Turkey)" + "uk_UA:uk:Ukrainian (Ukraine)" + "ur_IN:ur:Urdu (India)" + "uz_UZ:uz:Uzbek (Uzbekistan)" + "vi_VN:vi:Vietnamese (Vietnam)" + "yo_NG:yo:Yoruba (Nigeria)" + "yo_NG:yo:Yoruba (Nigeria)" + "yue_HK:yu:Cantonese (Hong Kong)" + "zh_CN:zh:Chinese (China)" + "zu_ZA:zu:Zulu (South Africa)" +) + +for i in "${langArr[@]}"; do + IFS=: read -r l1 l2 l3 <<< "$i" + if [ "$langInput" == "$l2" ]; then + lang="${l1}:${l2}" + languagePack="language-pack-${l2}" + fi +done + +if [ -z "$lang" ]; then + echo "plasmoidlocaletest doesn't recognize the language '$lang'" + echo "Eg:" + scriptcmd='sh ./plasmoidlocaletest' + for i in "${langArr[@]}"; do + IFS=: read -r l1 l2 l3 <<< "$i" + echo " ${scriptcmd} ${l2} | ${l3}" + done + echo "" + echo "Or use a the full locale code:" + echo " ${scriptcmd} ar_EG:ar" + exit 1 +fi + +IFS=: read -r l1 l2 <<< "${lang}" +l1="${l1}.UTF-8" + +# Check if language is installed +if [ ! -z "$languagePack" ]; then + if [ "$lang" == "zh_CN:zh" ]; then languagePack="language-pack-zh-hans" + fi + + checkIfLangInstalled "$languagePack" || exit 1 +fi + + +echo "LANGUAGE=\"${lang}\"" +echo "LANG=\"${l1}\"" + +scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +packageDir="${scriptDir}/.." + +# Build local translations for plasmoidviewer +sh "${scriptDir}/build" + +LANGUAGE="${lang}" LANG="${l1}" LC_TIME="${l1}" QML_DISABLE_DISK_CACHE=true plasmoidviewer -a "$packageDir" -l topedge -f horizontal -x 0 -y 0 diff --git a/com.github.adhec.OnzeMenuKDE/translate/pt-br.po b/com.github.adhec.OnzeMenuKDE/translate/pt-br.po index 30d28c2..2bab459 100644 --- a/com.github.adhec.OnzeMenuKDE/translate/pt-br.po +++ b/com.github.adhec.OnzeMenuKDE/translate/pt-br.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: OnzeMenu\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:33-0300\n" +"Report-Msgid-Bugs-To: https://github.com/adhec/OnzeMenuKDE\n" +"POT-Creation-Date: 2024-01-03 17:40+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: mateussmb mt.moreirabarros@gmail.com\n" "Language-Team: \n" @@ -19,14 +19,6 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Language: pt-br\n" -#: ../metadata.desktop -msgid "OnzeMenu 11" -msgstr "OnzeMenu 11" - -#: ../metadata.desktop -msgid "A configurable launcher menu 11" -msgstr "Um menu de lançador configurável 11" - #: ../contents/config/config.qml msgid "General" msgstr "Geral" @@ -65,6 +57,25 @@ msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Limpar Ícone" +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@label:textbox" +msgid "Text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@info:placeholder" +msgid "Type here to add a text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@action:button" +msgid "Reset menu label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Text label fontsize" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Menu position" msgstr "Posição do menu" @@ -180,3 +191,9 @@ msgstr "Voltar" #: ../contents/ui/MenuRepresentation.qml msgid "More" msgstr "Mais" + +#~ msgid "OnzeMenu 11" +#~ msgstr "OnzeMenu 11" + +#~ msgid "A configurable launcher menu 11" +#~ msgstr "Um menu de lançador configurável 11" diff --git a/com.github.adhec.OnzeMenuKDE/translate/ru.po b/com.github.adhec.OnzeMenuKDE/translate/ru.po index 65892b8..d36c525 100644 --- a/com.github.adhec.OnzeMenuKDE/translate/ru.po +++ b/com.github.adhec.OnzeMenuKDE/translate/ru.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: OnzeMenu\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:33-0300\n" +"Report-Msgid-Bugs-To: https://github.com/adhec/OnzeMenuKDE\n" +"POT-Creation-Date: 2024-01-03 17:40+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,14 +17,6 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../metadata.desktop -msgid "OnzeMenu 11" -msgstr "" - -#: ../metadata.desktop -msgid "A configurable launcher menu 11" -msgstr "Настраиваемое меню запуска OnzeMenu 11" - #: ../contents/config/config.qml msgid "General" msgstr "Основное" @@ -63,6 +55,25 @@ msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Удалить значок" +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@label:textbox" +msgid "Text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@info:placeholder" +msgid "Type here to add a text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@action:button" +msgid "Reset menu label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Text label fontsize" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Menu position" msgstr "Позиция меню" @@ -178,3 +189,6 @@ msgstr "Назад" #: ../contents/ui/MenuRepresentation.qml msgid "More" msgstr "Еще" + +#~ msgid "A configurable launcher menu 11" +#~ msgstr "Настраиваемое меню запуска OnzeMenu 11" diff --git a/com.github.adhec.OnzeMenuKDE/translate/template.pot b/com.github.adhec.OnzeMenuKDE/translate/template.pot index 7e68df4..7946c25 100644 --- a/com.github.adhec.OnzeMenuKDE/translate/template.pot +++ b/com.github.adhec.OnzeMenuKDE/translate/template.pot @@ -1,14 +1,14 @@ -# Translation of OnzeMenu in LANGUAGE -# Copyright (C) 2023 -# This file is distributed under the same license as the OnzeMenu package. +# Translation of OnzeMenuKDE in LANGUAGE +# Copyright (C) 2024 +# This file is distributed under the same license as the OnzeMenuKDE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: OnzeMenu\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:33-0300\n" +"Project-Id-Version: OnzeMenuKDE\n" +"Report-Msgid-Bugs-To: https://github.com/adhec/OnzeMenuKDE\n" +"POT-Creation-Date: 2024-01-03 17:40+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,14 +17,6 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../metadata.desktop -msgid "OnzeMenu 11" -msgstr "" - -#: ../metadata.desktop -msgid "A configurable launcher menu 11" -msgstr "" - #: ../contents/config/config.qml msgid "General" msgstr "" @@ -63,6 +55,25 @@ msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "" +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@label:textbox" +msgid "Text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@info:placeholder" +msgid "Type here to add a text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@action:button" +msgid "Reset menu label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Text label fontsize" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Menu position" msgstr "" diff --git a/com.github.adhec.OnzeMenuKDE/translate/tr.po b/com.github.adhec.OnzeMenuKDE/translate/tr.po index 1e43c4e..8acc5eb 100644 --- a/com.github.adhec.OnzeMenuKDE/translate/tr.po +++ b/com.github.adhec.OnzeMenuKDE/translate/tr.po @@ -6,8 +6,8 @@ #, fuzzy msgid "" msgstr "" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:33-0300\n" +"Report-Msgid-Bugs-To: https://github.com/adhec/OnzeMenuKDE\n" +"POT-Creation-Date: 2024-01-03 17:40+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Language-Team:\n" "Language: tr\n" @@ -18,14 +18,6 @@ msgstr "" "X-Language: tr_TR\n" "X-Source-Language: C\n" -#: ../metadata.desktop -msgid "OnzeMenu 11" -msgstr "OnzeMenu 11" - -#: ../metadata.desktop -msgid "A configurable launcher menu 11" -msgstr "Yapılandırılabilir başlatıcı menüsü 11" - #: ../contents/config/config.qml msgid "General" msgstr "Genel" @@ -64,6 +56,25 @@ msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Simgeyi Temizle" +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@label:textbox" +msgid "Text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@info:placeholder" +msgid "Type here to add a text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@action:button" +msgid "Reset menu label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Text label fontsize" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Menu position" msgstr "" @@ -179,3 +190,9 @@ msgstr "Geri" #: ../contents/ui/MenuRepresentation.qml msgid "More" msgstr "Daha" + +#~ msgid "OnzeMenu 11" +#~ msgstr "OnzeMenu 11" + +#~ msgid "A configurable launcher menu 11" +#~ msgstr "Yapılandırılabilir başlatıcı menüsü 11" diff --git a/com.github.adhec.OnzeMenuKDE/translate/uk.po b/com.github.adhec.OnzeMenuKDE/translate/uk.po index 5b48dc4..b70b4cb 100644 --- a/com.github.adhec.OnzeMenuKDE/translate/uk.po +++ b/com.github.adhec.OnzeMenuKDE/translate/uk.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: OnzeMenu\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:33-0300\n" +"Report-Msgid-Bugs-To: https://github.com/adhec/OnzeMenuKDE\n" +"POT-Creation-Date: 2024-01-03 17:40+0500\n" "PO-Revision-Date: 2023-04-07 HO:MI+ZONE\n" "Last-Translator: Mykhailo Stetsiuk \n" "Language-Team: \n" @@ -17,14 +17,6 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../metadata.desktop -msgid "OnzeMenu 11" -msgstr "OnzeMenu 11" - -#: ../metadata.desktop -msgid "A configurable launcher menu 11" -msgstr "Налаштовуваний засіб запуску програм 11" - #: ../contents/config/config.qml msgid "General" msgstr "Загальне" @@ -63,6 +55,25 @@ msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "Прибрати піктограму" +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@label:textbox" +msgid "Text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@info:placeholder" +msgid "Type here to add a text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@action:button" +msgid "Reset menu label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Text label fontsize" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Menu position" msgstr "Розташування меню" @@ -178,3 +189,9 @@ msgstr "Назад" #: ../contents/ui/MenuRepresentation.qml msgid "More" msgstr "Додатково" + +#~ msgid "OnzeMenu 11" +#~ msgstr "OnzeMenu 11" + +#~ msgid "A configurable launcher menu 11" +#~ msgstr "Налаштовуваний засіб запуску програм 11" diff --git a/com.github.adhec.OnzeMenuKDE/translate/zh_CN.po b/com.github.adhec.OnzeMenuKDE/translate/zh_CN.po index cf8a3aa..6300f5f 100644 --- a/com.github.adhec.OnzeMenuKDE/translate/zh_CN.po +++ b/com.github.adhec.OnzeMenuKDE/translate/zh_CN.po @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: OnzeMenu\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-30 00:33-0300\n" +"Report-Msgid-Bugs-To: https://github.com/adhec/OnzeMenuKDE\n" +"POT-Creation-Date: 2024-01-03 17:40+0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,14 +17,6 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: ../metadata.desktop -msgid "OnzeMenu 11" -msgstr "" - -#: ../metadata.desktop -msgid "A configurable launcher menu 11" -msgstr "一个可自定义的类Win11开始菜单" - #: ../contents/config/config.qml msgid "General" msgstr "通用" @@ -63,6 +55,25 @@ msgctxt "@item:inmenu Reset icon to default" msgid "Clear Icon" msgstr "清除图标" +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@label:textbox" +msgid "Text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@info:placeholder" +msgid "Type here to add a text label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgctxt "@action:button" +msgid "Reset menu label" +msgstr "" + +#: ../contents/ui/ConfigGeneral.qml +msgid "Text label fontsize" +msgstr "" + #: ../contents/ui/ConfigGeneral.qml msgid "Menu position" msgstr "菜单位置" @@ -178,3 +189,6 @@ msgstr "返回" #: ../contents/ui/MenuRepresentation.qml msgid "More" msgstr "更多" + +#~ msgid "A configurable launcher menu 11" +#~ msgstr "一个可自定义的类Win11开始菜单" diff --git a/push.sh b/push.sh index a9a24d8..345883e 100755 --- a/push.sh +++ b/push.sh @@ -1,3 +1,5 @@ #!/bin/bash git add . && git commit -m "Update" && git push + +echo "Ready"