[GRASS-SVN] r53042 - grass/branches/releasebranch_6_4/lib/init

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 1 01:17:23 PDT 2012


Author: marisn
Date: 2012-09-01 01:17:23 -0700 (Sat, 01 Sep 2012)
New Revision: 53042

Modified:
   grass/branches/releasebranch_6_4/lib/init/init.sh
Log:
Switch language based on user preferences on nix systems. Related to r53041. Requested by #1699

Modified: grass/branches/releasebranch_6_4/lib/init/init.sh
===================================================================
--- grass/branches/releasebranch_6_4/lib/init/init.sh	2012-09-01 08:13:25 UTC (rev 53041)
+++ grass/branches/releasebranch_6_4/lib/init/init.sh	2012-09-01 08:17:23 UTC (rev 53042)
@@ -233,11 +233,6 @@
     	GRASS_GUI=`awk '/GRASS_GUI/ {print $2}' "$GISRC"`
     fi
 
-    # Check for a reference to the language in the grassrc file
-    if [ -f "$GISRC" ] ; then
-    	LANG=`awk '/LANG/ {print $2}' "$GISRC"`
-    fi
-
     # Set the GRASS user interface to the default if needed
     if [ ! "$GRASS_GUI" ] ; then
 	GRASS_GUI="$DEFAULT_GUI"
@@ -253,12 +248,23 @@
 # Set PATH to GRASS bin, ETC to GRASS etc
 ETC="$GISBASE/etc"
 
-if [ "$LC_ALL" ] ; then
-	LCL=`echo "$LC_ALL" | sed 's/\(..\)\(.*\)/\1/'`
-elif [ "$LC_MESSAGES" ] ; then
-	LCL=`echo "$LC_MESSAGES" | sed 's/\(..\)\(.*\)/\1/'`
+# Check for a reference to the language in the grassrc file
+if [ -f "$GISRC" ] ; then
+    LANG=`awk '/LANG/ {print $2}' "$GISRC"`
+fi
+
+if [ $LANG ] ; then
+    LCL=$LANG
+    export LANG
+    export LANGUAGE=$LANG
 else
-	LCL=`echo "$LANG" | sed 's/\(..\)\(.*\)/\1/'`
+    if [ "$LC_ALL" ] ; then
+        LCL=`echo "$LC_ALL" | sed 's/\(..\)\(.*\)/\1/'`
+    elif [ "$LC_MESSAGES" ] ; then
+        LCL=`echo "$LC_MESSAGES" | sed 's/\(..\)\(.*\)/\1/'`
+    else
+        LCL=`echo "$LANG" | sed 's/\(..\)\(.*\)/\1/'`
+    fi
 fi
 
 # if it doesn't exist set it to something so that g.extension's default is reasonable



More information about the grass-commit mailing list