aboutsummaryrefslogtreecommitdiffstats
path: root/xinit.d
diff options
context:
space:
mode:
authorFrederic Crozat <fcrozat@mandriva.com>2005-08-29 09:56:00 +0000
committerFrederic Crozat <fcrozat@mandriva.com>2005-08-29 09:56:00 +0000
commit06b45e8f135db049440b3e930dedd6311eacd55f (patch)
treeeae6182c40038ac6eff559fa5887ca9c881a720e /xinit.d
parent04e86e3cfa583647e5c8ce9067ea1dd37345b27a (diff)
downloadcommon-data-06b45e8f135db049440b3e930dedd6311eacd55f.tar
common-data-06b45e8f135db049440b3e930dedd6311eacd55f.tar.gz
common-data-06b45e8f135db049440b3e930dedd6311eacd55f.tar.bz2
common-data-06b45e8f135db049440b3e930dedd6311eacd55f.tar.xz
common-data-06b45e8f135db049440b3e930dedd6311eacd55f.zip
Fix when no translation is available
Diffstat (limited to 'xinit.d')
-rwxr-xr-xxinit.d/desktop-directories10
1 files changed, 6 insertions, 4 deletions
diff --git a/xinit.d/desktop-directories b/xinit.d/desktop-directories
index 985d85c..64f9d34 100755
--- a/xinit.d/desktop-directories
+++ b/xinit.d/desktop-directories
@@ -3,6 +3,7 @@
USER_STAMP=$HOME/.mdk-folders
if [ ! -e $USER_STAMP ]; then
+. /etc/profile.d/10lang.sh
locale=C
if [ ! -z "$LC_ALL" ]; then
locale=$LC_ALL
@@ -11,22 +12,23 @@ if [ ! -e $USER_STAMP ]; then
elif [ ! -z "$LANG" ]; then
locale=$LANG
fi
+ CHARSET=`locale charmap`
[ -d $HOME/.mdk-folders ] || mkdir -p $HOME/.mdk-folders
for file in /usr/share/mdk/menu/*-mdk.desktop.template ; do
- TARGET_DIR=`grep Name[$locale] $file | sed -e 's|.*=||g'`
+ TARGET_DIR=`grep -m1 -F Name[$locale]= $file | sed -e 's|.*=||g'`
if [ -z "$TARGET_DIR" ]; then
locale=`echo $locale | sed -e 's/_.*//g' -e 's/@.*//g'`
- TARGET_DIR=`grep -F Name[$locale] $file | sed -e 's|.*=||g'`
+ TARGET_DIR=`grep -m1 -F Name[$locale]= $file | sed -e 's|.*=||g'`
fi
if [ -z "$TARGET_DIR" ]; then
- TARGET_DIR=`grep -F Name $file | sed -e 's|.*=||g'`
+ TARGET_DIR=`grep -m1 -F Name= $file | sed -e 's|.*=||g'`
fi
if [ "$CHARSET" != "UTF-8" ]; then
- TARGET_DIR=`echo $TARGET_DIR | iconv -f UTF-8 -t "$CHARSET"`
+ TARGET_DIR=`echo $TARGET_DIR | iconv -f UTF-8 -t "$CHARSET" 2>/dev/null`
fi