Page 1 of 1
Bug in EasyJWM for non English language
Posted: Sun Aug 11, 2024 5:31 pm
by Caramel
There is a bug in MenuManager in EasyOS when it is used in a language other than English
When you change the category the entries (in the column "Éléments du menu visibles" in the pîcture) are never displayed:
- capture11193.png (64.56 KiB) Viewed 753 times
Cause of the problem :
In fact, when you choose a category, for example "Système de fichiers" like in the picture, the script /usr/local/easyjwm/menumanager call an internal function "Système de fichiers" that do not exist. The real name of the function is Filesystem (= "Système de fichiers" in French)
Re: Bug in EasyJWM for non English language
Posted: Mon Aug 12, 2024 5:57 am
by Caramel
Possible solution. There may be smarter.
Addition of the sub function execute
Code: Select all
execute() {
case $1 in
$(gettext 'Desktop'))
Desktop
;;
$(gettext 'System'))
System
;;
$(gettext 'Setup'))
Setup
;;
$(gettext 'Utility'))
Utility
;;
$(gettext 'Filesystem'))
Filesystem
;;
$(gettext 'Graphic'))
Graphic
;;
$(gettext 'Document'))
Document
;;
$(gettext 'Business'))
Business
;;
$(gettext 'Personal'))
Personal
;;
$(gettext 'Network'))
Network
;;
$(gettext 'Internet'))
Internet
;;
$(gettext 'Multimedia'))
Multimedia
;;
$(gettext 'Fun'))
Fun
;;
esac
}
export -f execute
and replacement of
Code: Select all
<action signal="button-release-event">$CATEGORY</action>
by
Code: Select all
<action signal="button-release-event">execute $CATEGORY</action>
EDIT : typo in code fixed
Re: Bug in EasyJWM for non English language
Posted: Mon Aug 12, 2024 8:13 am
by Caramel
The names of menu items are always in English even if a localization exists.
- capture691.png (87.21 KiB) Viewed 718 times
Proposal of modification:
Addition of
Code: Select all
SHORTLANG=`echo $LANG | cut -c 1-2`
TEXT=^Name\\[$SHORTLANG\\]=
export TEXT
Example : If LANG=fr_FR.UTF-8,
SHORTLANG=fr and TEXT=^Name\[fr\]=
In the internal functions, all the lines
Code: Select all
NAME=$(grep -a -m1 '^Name=' ${DTDIR}/"${FILE}" | cut -d '=' -f2)
(Example: If FILE=alsamixer.desktop, NAME=AlsaMixer audio mixer. This is how Alsamixer is presented in the menu(section Multimedia/Sound) in English
are replaced by
Code: Select all
NAME=$(grep -a -m1 "$TEXT" ${DTDIR}/"${FILE}" | cut -d '=' -f2)
if [[ ! $NAME ]]; then
NAME=$(grep -a -m1 '^Name=' ${DTDIR}/"${FILE}" | cut -d '=' -f2)
fi
If the Name in the localised language exists, it's this name that will be use.
(Example: If FILE=alsamixer.desktop, NAME=Mixeur audio : AlsaMixer)
- capture1049.png (87.51 KiB) Viewed 718 times
EDIT: fix of a copy/paste error in a line of code
Re: Bug in EasyJWM for non English language
Posted: Tue Aug 13, 2024 11:53 am
by BarryK
Caramel,
Thanks for reporting this problem, and the suggested fixes.
Based on your ideas, I have implemented fixes in the script. Here is the github commit to /usr/local/easyjwm/menumanager:
https://github.com/bkauler/woofq/commit ... 14f6eae61e
@radky
EasyJWM is based upon part of JWMDesk created by radky.
Roger, you might be interested in the non-English fixes in that script.
Re: Bug in EasyJWM for non English language
Posted: Wed Aug 14, 2024 1:47 pm
by BarryK
@radky @Caramel
I have just realized, one of those French categories has space characters.
So I think line 211 in menumanager script should be changed from
Code: Select all
enCAT=`grep -F "|${@}|" /tmp/easyjwm/mm-categories | cut -f 3 -d '|'`