diff --git a/NodeChrome/wrap_chrome_binary b/NodeChrome/wrap_chrome_binary index d23c0f5f4..df5e4b288 100755 --- a/NodeChrome/wrap_chrome_binary +++ b/NodeChrome/wrap_chrome_binary @@ -4,21 +4,24 @@ WRAPPER_PATH=$(readlink -f /usr/bin/google-chrome) BASE_PATH="$WRAPPER_PATH-base" mv "$WRAPPER_PATH" "$BASE_PATH" +# Debian/Ubuntu seems to not respect --lang, it instead needs to be a LANGUAGE environment var +# See: https://stackoverflow.com/a/41893197/359999 +for var in "$@"; do + if [[ $var == --lang=* ]]; then + LANGUAGE=${var//--lang=} + fi +done + cat > "$WRAPPER_PATH" <<_EOF #!/bin/bash # umask 002 ensures default permissions of files are 664 (rw-rw-r--) and directories are 775 (rwxrwxr-x). umask 002 +# Set language environment variable +export LANGUAGE="$LANGUAGE" + # Note: exec -a below is a bashism. exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@" _EOF chmod +x "$WRAPPER_PATH" - -# Debian/Ubuntu seems to not respect --lang, it instead needs to be a LANGUAGE environment var -# See: https://stackoverflow.com/a/41893197/359999 -for var in "$@"; do - if [[ $var == --lang=* ]]; then - export LANGUAGE=${var//--lang=} - fi -done diff --git a/NodeEdge/wrap_edge_binary b/NodeEdge/wrap_edge_binary index 4e998663b..7f011cf1d 100755 --- a/NodeEdge/wrap_edge_binary +++ b/NodeEdge/wrap_edge_binary @@ -4,21 +4,24 @@ WRAPPER_PATH=$(readlink -f /usr/bin/microsoft-edge) BASE_PATH="$WRAPPER_PATH-base" mv "$WRAPPER_PATH" "$BASE_PATH" +# Debian/Ubuntu seems to not respect --lang, it instead needs to be a LANGUAGE environment var +# See: https://stackoverflow.com/a/41893197/359999 +for var in "$@"; do + if [[ $var == --lang=* ]]; then + LANGUAGE=${var//--lang=} + fi +done + cat > "$WRAPPER_PATH" <<_EOF #!/bin/bash # umask 002 ensures default permissions of files are 664 (rw-rw-r--) and directories are 775 (rwxrwxr-x). umask 002 +# Set language environment variable +export LANGUAGE="$LANGUAGE" + # Note: exec -a below is a bashism. exec -a "\$0" "$BASE_PATH" --no-sandbox "\$@" _EOF chmod +x "$WRAPPER_PATH" - -# Debian/Ubuntu seems to not respect --lang, it instead needs to be a LANGUAGE environment var -# See: https://stackoverflow.com/a/41893197/359999 -for var in "$@"; do - if [[ $var == --lang=* ]]; then - export LANGUAGE=${var//--lang=} - fi -done