Skip to contentSkip to conversation

Filter out POSIX locale for translation

PATCH In review Michael Chang 2 participants 2 messages Oct 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Filter out POSIX locale for translation

The POSIX locale is default or native operating system's locale identical to the C locale, so no translation to human speaking languages provided.

For this reason we should filter out LANG=POSIX as well as LANG=C upon generating grub.cfg to avoid looking up for it's gettext's message catalogs that will consequently result in the unpleasant message.

error: file `/boot/grub/locale/POSIX.gmo' not found

---
 util/grub.d/00_header.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/grub.d/00_header.in +1 -1
index 93a90233e..f74c2a4c6 100644
@@ -191,7 +191,7 @@ EOF
 EOF
 
 # Gettext variables and module
-if [ "x${LANG}" != "xC" ] &&  [ "x${LANG}" != "x" ]; then
+if [ "x${LANG}" != "xC" ] && [ "x${LANG}" != "xPOSIX" ] && [ "x${LANG}" != "x" ]; then
   cat << EOF
   set locale_dir=\$prefix/locale
   set lang=${grub_lang}
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Michael Chang via Grub-devel

The POSIX locale is default or native operating system's locale identical to the C locale, so no translation to human speaking languages provided.

For this reason we should filter out LANG=POSIX as well as LANG=C upon generating grub.cfg to avoid looking up for it's gettext's message catalogs that will consequently result in the unpleasant message.

error: file `/boot/grub/locale/POSIX.gmo' not found

Daniel