diff --git a/installer/resources/i2prouter b/installer/resources/i2prouter index 793555a01..f6d80be23 100644 --- a/installer/resources/i2prouter +++ b/installer/resources/i2prouter @@ -107,6 +107,22 @@ WAIT_FOR_STARTED_TIMEOUT=120 # flag for using upstart when installing (rather than init.d rc.d) USE_UPSTART= +# Source the environment variables for the locale if $LANG isn't set +# If you want to set custom locale variables for I2P, +# you may comment out this block and set them yourself here. + +if [ ! -n $LANG ]; then + for ENV_FILE in /etc/environment /etc/default/locale; do + [ -r "$ENV_FILE" ] || continue + [ -s "$ENV_FILE" ] || continue + + for var in LANG LANGUAGE LC_ALL LC_CTYPE; do + value=`egrep "^${var}=" "$ENV_FILE" | tail -n1 | cut -d= -f2` + [ -n "$value" ] && eval export $var=$value + done + done +fi + # When installing on On Mac OSX platforms, the following domain will be used to # prefix the plist file name. PLIST_DOMAIN=org.tanukisoftware.wrapper