mirror of
https://github.com/nmap/nmap.git
synced 2025-12-31 03:49:01 +00:00
Add checks for $lang variable
We now use AppleLanguages to provide a good language to Zenmap. This should prevent Zenmap from choosing wrong locale/languages settings.
This commit is contained in:
@@ -34,15 +34,14 @@ PYTHONPATH="$bundle_res/lib/zenmap"
|
||||
export PYTHONPATH
|
||||
|
||||
# We need a UTF-8 locale.
|
||||
if test "x$LANG" == "x"; then
|
||||
lang=`defaults read .GlobalPreferences AppleLocale 2>/dev/null`
|
||||
if test "$?" != "0"; then
|
||||
lang=`defaults read .GlobalPreferences AppleCollationOrder 2>/dev/null | sed 's/_.*//'`
|
||||
fi
|
||||
if test "$?" == "0"; then
|
||||
export LANG="`grep \"\`echo $lang\`_\" /usr/share/locale/locale.alias | \
|
||||
tail -n1 | sed 's/\./ /' | awk '{print $2}'`.UTF-8"
|
||||
fi
|
||||
if [ -z ${lang+x} ]; then
|
||||
# lang is unset
|
||||
lang=`defaults read /Library/Preferences/.GlobalPreferences AppleLanguages 2>/dev/null | awk '{ print $1 }' | head -n2 | tail -n1 | sed 's/\,/ /'`
|
||||
if [ -z ${lang+x} ]; then
|
||||
# lang is still unset
|
||||
lang=`defaults read .GlobalPreferences AppleLocale 2>/dev/null`
|
||||
fi
|
||||
export LANG="`grep \"\`echo $lang\`_\" /usr/share/locale/locale.alias | tail -n1 | sed 's/\./ /' | awk '{print $2}'`.UTF-8"
|
||||
fi
|
||||
|
||||
if test -f "$bundle_lib/charset.alias"; then
|
||||
|
||||
Reference in New Issue
Block a user