Yes I have them en masse: created by momanager.SFR wrote:... I have never encountered a .desktop file where 'Name[lang]=' is before 'Name=' (that's where my "assumption" came from ), have you?
I have changed it in latest momanager now, but there might still exist many of them.
That is, of course much better (and we have hundreds of millisecods available) !SFR wrote:Takes slightly more time, too, but still way below 0.100s (i3@2.13GHz).
Btw, side effect: it now picks up correct 'Name=' field from transmission-qt.desktop (an issue mentioned on previous page).
So I leave my script, integrated into findnrun for the records only.
Code: Select all
.
.
.
LOC1="/usr/share/applications/"
LOC2="/usr/local/share/applications/"
LOC3="${XDG_DATA_HOME}/applications/"
#LOC4="${HOME}/.local/share/applications/"
CONFIG="${HOME}/.findnrunrc"
check_and_fix() {
DIR=${1%/*}
if [ -d ${DIR} ]; then
mv -f ${DIR} ${DIR}_ || exit 0
mkdir -p ${DIR}
cd ${DIR}_
for f in `ls *.desktop`; do
sed q $f > ${DIR}/${f} # first line: [Desktop Entry]
sort $f | grep -v '^\[' >> ${DIR}/${f}
done
cd - >/dev/null
rm -rf ${DIR}_
fi
}
case $1 in -c)
Xdialog --msgbox "Check and fix sort order of translations ..." 0 0 &
cPID=$!
for LOC in $LOC1 $LOC2 $LOC3 ; do check_and_fix $LOC; done
kill $cPID
exit
esac
Code: Select all
<AppMenu>
<Item option="-c" icon="gtk-find">
<Label>Check and fix order of translation</Label>
<Label xml:lang="de">Reihenfolge der Übersetzungen prüfen und reparieren</Label>
</Item>