Skip to content

Commit

Permalink
braille: Fix picking locale from newer liblouis files (#9)
Browse files Browse the repository at this point in the history
Since version 3.21.0 liblouis uses language/region instead of locale.
  • Loading branch information
sthibaul authored Jul 26, 2024
1 parent cfcb000 commit 3df7f94
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions filter/liblouis1.defs.gen.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

#
# Copyright (c) 2015, 2017-2018, 2020 Samuel Thibault <samuel.thibault@ens-lyon.org>
# Copyright (c) 2015, 2017-2018, 2020, 2024 Samuel Thibault <samuel.thibault@ens-lyon.org>
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
Expand Down Expand Up @@ -215,9 +215,12 @@ echo ' Choice "HyphLocale/Default hyphenation rules for language" ""'
"zh-hk") LANGUAGE=Chinese LOCATION="Hong Kong" TYPE="grade 1" ;;
"zh-tw") LANGUAGE=Chinese LOCATION="Taiwan" TYPE="grade 1" ;;
"zh-chn") LANGUAGE=Chinese LOCATION="China" TYPE="grade 1" ;;
*) locale=$(grep ^#+locale: "$i" | cut -d ':' -f 2-)
*) locale=$(grep -e '^#+\(locale\|region\):' "$i" | cut -d ':' -f 2-)
language=$(grep ^#+language: "$i" | cut -d ':' -f 2-)
if [ -n "$locale" ]; then
LANGUAGE="$locale"
elif [ -n "$language" ]; then
LANGUAGE="$language"
fi
if [ $ext = ctb ]; then
TYPE="contracted"
Expand Down

0 comments on commit 3df7f94

Please sign in to comment.