]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix matching of languages in the LINGUAS environment variable.
authorBruno Haible <bruno@clisp.org>
Sun, 6 Sep 2020 19:28:50 +0000 (21:28 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 9 Oct 2022 07:30:42 +0000 (09:30 +0200)
Setting LINGUAS e.g. to "frs" should not cause fr.mo to get installed,
because Frisian is not a variant of French.

Reported by <arfrever.fta@gmail.com> in <https://savannah.gnu.org/bugs/?59062>.

* gettext-runtime/m4/po.m4 (AM_PO_SUBDIRS, AM_POSTPROCESS_PO_MAKEFILE): Don't
consider $desiredlang a variant of $presentlang unless it has the syntax of a
variant.

gettext-runtime/m4/po.m4

index ace6f960ae1572a27918cbb3eb4440b45bd3aac0..2f14f8e2b1bb2fb8933e5f169fd35fa7512d8564 100644 (file)
@@ -1,4 +1,4 @@
-# po.m4 serial 31 (gettext-0.20.2)
+# po.m4 serial 32 (gettext-0.21.1)
 dnl Copyright (C) 1995-2014, 2016, 2018-2022 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -179,7 +179,9 @@ changequote([,])dnl
                 #      presentlang can be used as a fallback for messages
                 #      which are not translated in the desiredlang catalog).
                 case "$desiredlang" in
-                  "$presentlang"*) useit=yes;;
+                  "$presentlang" | "$presentlang"_* | "$presentlang".* | "$presentlang"@*)
+                    useit=yes
+                    ;;
                 esac
               done
               if test $useit = yes; then
@@ -379,7 +381,9 @@ changequote([,])dnl
         #      presentlang can be used as a fallback for messages
         #      which are not translated in the desiredlang catalog).
         case "$desiredlang" in
-          "$presentlang"*) useit=yes;;
+          "$presentlang" | "$presentlang"_* | "$presentlang".* | "$presentlang"@*)
+            useit=yes
+            ;;
         esac
       done
       if test $useit = yes; then