From 3df7f94cb73402a8b1a0df71a70a6826823cc2e0 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 27 Jul 2024 01:47:02 +0200 Subject: [PATCH] braille: Fix picking locale from newer liblouis files (#9) Since version 3.21.0 liblouis uses language/region instead of locale. --- filter/liblouis1.defs.gen.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/filter/liblouis1.defs.gen.in b/filter/liblouis1.defs.gen.in index e60a8a88f..a14bf33c5 100644 --- a/filter/liblouis1.defs.gen.in +++ b/filter/liblouis1.defs.gen.in @@ -1,7 +1,7 @@ #!/bin/bash # -# Copyright (c) 2015, 2017-2018, 2020 Samuel Thibault +# Copyright (c) 2015, 2017-2018, 2020, 2024 Samuel Thibault # # Licensed under Apache License v2.0. See the file "LICENSE" for more # information. @@ -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"