]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make internationalization tests stricter on Solaris 11 systems.
authorBruno Haible <bruno@clisp.org>
Thu, 15 Jun 2023 15:00:56 +0000 (17:00 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 15 Jun 2023 22:08:07 +0000 (00:08 +0200)
* gettext-tools/tests/format-c-5-prg.c (main): Don't expect an Arabic digit
output in a locale other than Farsi.
* gettext-tools/tests/format-c-5: Try an Arabic locale as well.

gettext-tools/tests/format-c-5
gettext-tools/tests/format-c-5-prg.c

index d0cba225c2d4e3db1de342ecf2c44ef645bb29f2..2f70335e9ac589d8989154facbc3c22ee1173af5 100755 (executable)
@@ -80,11 +80,33 @@ else
     *) Exit 1;;
   esac
 
+  # Some systems (e.g. Solaris 11) don't have a Farsi locale.
+  # Therefore try an Arabic locale as well.
+  test -d ar || mkdir ar
+  test -d ar/LC_MESSAGES || mkdir ar/LC_MESSAGES
+  cp fa/LC_MESSAGES/fc5.mo ar/LC_MESSAGES/fc5.mo
+
+  prepare_locale_ ar ar_EG
+  LANGUAGE= ../fc5 ar_EG
+  case $? in
+    0) skipped=false ;;
+    77) ;;
+    *) Exit 1;;
+  esac
+
+  prepare_locale_ ar ar_EG.UTF-8
+  LANGUAGE= ../fc5 ar_EG.UTF-8
+  case $? in
+    0) skipped=false ;;
+    77) ;;
+    *) Exit 1;;
+  esac
+
   if $skipped; then
     if test -f /usr/bin/localedef; then
-      echo "Skipping test: no Farsi locale is installed"
+      echo "Skipping test: no Farsi or Arabic locale is installed"
     else
-      echo "Skipping test: no Farsi locale is supported"
+      echo "Skipping test: no Farsi or Arabic locale is supported"
     fi
     Exit 77
   fi
index eacbbf91a51f973afeac96a253ff2bbc910350c6..01e5c99c5c177e31764e818b64aea90475dc72aa 100644 (file)
@@ -66,7 +66,10 @@ main (int argc, char *argv[])
   en = "father of %d children";
 #if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__
   expected_translation = "Vater von %Id Kindern";
-  expected_result = "Vater von \xdb\xb5 Kindern";
+  if (strncmp (argv[1], "fa", 2) == 0)
+    expected_result = "Vater von \xdb\xb5 Kindern";
+  else
+    expected_result = "Vater von 5 Kindern";
 #else
   expected_translation = "Vater von %d Kindern";
   expected_result = "Vater von 5 Kindern";