From ed21a2bdecdd971ffc9df9c21e26381832840724 Mon Sep 17 00:00:00 2001 From: jsa34 <31512041+jsa34@users.noreply.github.com> Date: Tue, 31 Jan 2023 13:50:30 +0000 Subject: [PATCH] Refine lang setting (#1778) [deploy] --- NodeChrome/wrap_chrome_binary | 19 +++++++++++-------- NodeEdge/wrap_edge_binary | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) 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