Skip to content

Commit

Permalink
fix Apache language auto-detection on Firefox for Chinese locales
Browse files Browse the repository at this point in the history
closes #375
  • Loading branch information
eighthave committed May 7, 2019
1 parent 2948fb9 commit daf47ed
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tools/prepare-multi-lang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ function convert_weblate_language_code {
echo ${LANG_CODE} | tr '[:upper:]' '[:lower:]' | tr '_' '-'
}

# There are only zh-hans (Simplified) and zh-hant (Traditional)
# translations, but Firefox uses country codes instead of language
# code. So tack those on at the end, since we always have both zh.
function write_typemap {
OUTPUT_FILE=$1
LANGS_TO_WRITE=$2
Expand All @@ -90,7 +93,20 @@ Content-type: text/html
TXT
done
cat<<TXT >> ${OUTPUT_FILE}
URI: ${FILE_NAME}.zh_Hans
Content-language: zh-cn
Content-type: text/html
URI: ${FILE_NAME}.zh_Hant
Content-language: zh-hk
Content-type: text/html
URI: ${FILE_NAME}.zh_Hant
Content-language: zh-tw
Content-type: text/html
TXT
}

if [ ! -f _config.yml ]; then
Expand Down

0 comments on commit daf47ed

Please sign in to comment.