Skip to content

Commit 17c197c

Browse files
mbifeldvmarcella
authored andcommitted
Covered case where no LANG var is set
1 parent a93deac commit 17c197c

File tree

1 file changed

+37
-34
lines changed

1 file changed

+37
-34
lines changed

scripts/install_from_release.sh

+37-34
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,45 @@ fi
1313
# Set a default scenarios file
1414
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/scenarios.zip"
1515

16-
# Map the language parameter to the corresponding scenarios file
17-
# If no parameter, download the scenarios from IE
18-
MAIN_LANG_PREFIX="$(echo "$LANG" | head -c2 | tr '[:upper:]' '[:lower:]')"
19-
LANG_ARRAY=("de" "es" "fr" "it" "nl" "pt" "zh" "cs" "hu" "id" "ja" "ko" "pl" "pt" "ru" "sv" "tr")
20-
21-
if [[ "${LANG_ARRAY[*]}" =~ "$MAIN_LANG_PREFIX" ]]; then
22-
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-$MAIN_LANG_PREFIX-scenarios.zip"
23-
if [ "$MAIN_LANG_PREFIX" = "pt" ]; then
24-
if [ "$LANG" = "pt-pt" ]; then
25-
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/pt-pt-scenarios.zip"
26-
elif [ "$LANG" = "pt-br" ]; then
27-
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/pt-br-scenarios.zip"
28-
else
29-
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/pt-pt-scenarios.zip"
16+
# If the LANG parameter was set, download appropriate script
17+
if [-n "$LANG" ]; then
18+
# Map the language parameter to the corresponding scenarios file
19+
# If no parameter, download the scenarios from IE
20+
MAIN_LANG_PREFIX="$(echo "$LANG" | head -c2 | tr '[:upper:]' '[:lower:]')"
21+
LANG_ARRAY=("de" "es" "fr" "it" "nl" "pt" "zh" "cs" "hu" "id" "ja" "ko" "pl" "pt" "ru" "sv" "tr")
22+
23+
if [[ "${LANG_ARRAY[*]}" =~ "$MAIN_LANG_PREFIX" ]]; then
24+
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-$MAIN_LANG_PREFIX-scenarios.zip"
25+
if [ "$MAIN_LANG_PREFIX" = "pt" ]; then
26+
if [ "$LANG" = "pt-pt" ]; then
27+
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/pt-pt-scenarios.zip"
28+
elif [ "$LANG" = "pt-br" ]; then
29+
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/pt-br-scenarios.zip"
30+
else
31+
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/pt-pt-scenarios.zip"
32+
fi
3033
fi
31-
fi
32-
if [ "$MAIN_LANG_PREFIX" = "zh" ]; then
33-
if [ "$LANG" = "zh-cn" ]; then
34-
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-cn-scenarios.zip"
35-
elif [ "$LANG" = "zh-tw" ]; then
36-
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-tw-scenarios.zip"
37-
else
38-
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-cn-scenarios.zip"
34+
if [ "$MAIN_LANG_PREFIX" = "zh" ]; then
35+
if [ "$LANG" = "zh-cn" ]; then
36+
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-cn-scenarios.zip"
37+
elif [ "$LANG" = "zh-tw" ]; then
38+
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-tw-scenarios.zip"
39+
else
40+
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-cn-scenarios.zip"
41+
fi
42+
fi
43+
if [ "$MAIN_LANG_PREFIX" = "cs" ]; then
44+
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-cz-scenarios.zip"
45+
fi
46+
if [ "$MAIN_LANG_PREFIX" = "ja" ]; then
47+
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-jp-scenarios.zip"
48+
fi
49+
if [ "$MAIN_LANG_PREFIX" = "ko" ]; then
50+
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-kr-scenarios.zip"
51+
fi
52+
if [ "$MAIN_LANG_PREFIX" = "sv" ]; then
53+
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-se-scenarios.zip"
3954
fi
40-
fi
41-
if [ "$MAIN_LANG_PREFIX" = "cs" ]; then
42-
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-cz-scenarios.zip"
43-
fi
44-
if [ "$MAIN_LANG_PREFIX" = "ja" ]; then
45-
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-jp-scenarios.zip"
46-
fi
47-
if [ "$MAIN_LANG_PREFIX" = "ko" ]; then
48-
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-kr-scenarios.zip"
49-
fi
50-
if [ "$MAIN_LANG_PREFIX" = "sv" ]; then
51-
SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-se-scenarios.zip"
5255
fi
5356
fi
5457

0 commit comments

Comments
 (0)