techee commented on this pull request.
@@ -66,41 +66,49 @@ I18NDIR="$bundle_data/locale"
# Set the locale-related variables appropriately: unset LANG LC_MESSAGES LC_MONETARY LC_COLLATE
+# Start by attempting to find the Locale preference. +APPLELOCALE=`defaults read .GlobalPreferences AppleLocale` +if test -f "$I18NDIR/${APPLELOCALE:0:5}/LC_MESSAGES/$APP.mo"; then + if test -z $LANG; then + export LANG="${APPLELOCALE:0:5}" + fi +elif test -f "$I18NDIR/${APPLELOCALE:0:2}/LC_MESSAGES/$APP.mo"; then + export LANG="${APPLELOCALE:0:5}"
Yeah. It could also be probably changed to `export LANG="$APPLELOCALE"` as there should never be anything longer in the variable.