|
12 | 12 |
|
13 | 13 | # Map the language parameter to the corresponding scenarios file
|
14 | 14 | # If no parameter, download the scenarios from IE
|
15 |
| -if [ "$LANG" = "" ]; then |
| 15 | +MAIN_LANG_PREFIX="$(echo "$LANG" | head -c2 | tr '[:upper:]' '[:lower:]')" |
| 16 | +LANG_ARRAY_1=("de" "es" "fr" "it" "nl" "pt") |
| 17 | +LANG_ARRAY_2=("cs" "hu" "id" "ja" "ko" "pl" "pt" "ru" "sv" "tr") |
| 18 | + |
| 19 | +if [ "$MAIN_LANG_PREFIX" = "" ] || [ "$MAIN_LANG_PREFIX" = "en" ]; then |
16 | 20 | SCENARIOS="https://github.com/Azure/InnovationEngine/releases/download/$RELEASE/scenarios.zip"
|
17 |
| -# Otherwise, download the scenarios from Microsoft Docs in the appropriate langauge |
18 |
| -elif [ "$LANG" = "en-us" ]; then |
19 |
| - SCENARIOS='https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/scenarios.zip' |
| 21 | +elif [ "$MAIN_LANG_PREFIX" = "pt" ]; then |
| 22 | + if [ "$LANG" = 'pt-pt' ]; then |
| 23 | + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/pt-pt-scenarios.zip" |
| 24 | + elif [ "$LANG" = 'pt-br' ]; then |
| 25 | + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/pt-br-scenarios.zip" |
| 26 | + fi |
| 27 | +elif [ "$MAIN_LANG_PREFIX" = "zh" ]; then |
| 28 | + if [ "$LANG" = "zh-cn" ]; then |
| 29 | + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-cn-scenarios.zip" |
| 30 | + elif [ "$LANG" = "zh-tw" ]; then |
| 31 | + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-tw-scenarios.zip" |
| 32 | + else |
| 33 | + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/zh-cn-scenarios.zip" |
| 34 | + fi |
| 35 | +elif [[ ${LANG_ARRAY_1[@]} =~ $MAIN_LANG_PREFIX ]]; then |
| 36 | + # for any other language that we do not have a specific scenarios file for, we will use the generic one |
| 37 | + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-$MAIN_LANG_PREFIX-scenarios.zip" |
| 38 | +elif [[ ${LANG_ARRAY_2[@]} =~ $MAIN_LANG_PREFIX ]]; then |
| 39 | + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-$MAIN_LANG_PREFIX-scenarios.zip" |
| 40 | + if [ "$MAIN_LANG_PREFIX" = "cs" ]; then |
| 41 | + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-cz-scenarios.zip" |
| 42 | + elif [ "$MAIN_LANG_PREFIX" = "ja" ]; then |
| 43 | + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-jp-scenarios.zip" |
| 44 | + elif [ "$MAIN_LANG_PREFIX" = "ko" ]; then |
| 45 | + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-kr-scenarios.zip" |
| 46 | + elif [ "$MAIN_LANG_PREFIX" = "sv" ]; then |
| 47 | + SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$MAIN_LANG_PREFIX-se-scenarios.zip" |
| 48 | + fi |
20 | 49 | else
|
21 |
| - SCENARIOS="https://github.com/MicrosoftDocs/executable-docs/releases/download/v1.0.1/$LANG-scenarios.zip" |
| 50 | + SCENARIOS="https://github.com/Azure/InnovationEngine/releases/download/$RELEASE/scenarios.zip" |
22 | 51 | fi
|
23 | 52 |
|
24 | 53 | # Download the binary
|
|
0 commit comments