]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix some more localization issues on macOS (<rdar://problem/27245567>)
authorMichael Sweet <michael.r.sweet@gmail.com>
Wed, 8 Mar 2017 19:35:12 +0000 (14:35 -0500)
committerMichael Sweet <michael.r.sweet@gmail.com>
Wed, 8 Mar 2017 19:35:12 +0000 (14:35 -0500)
CHANGES.txt
cups/ppd-localize.c
cups/ppd.c

index 7cbf24a5aad59dee3bf76b320c5ed9f5210825f2..b9cb71f407630cc7fe50afb9d3b7883dd30851c8 100644 (file)
@@ -7,7 +7,7 @@ CHANGES IN CUPS V2.2.3
          causing a hung queue (<rdar://problem/28008717>)
        - The scheduler could pause responding to client requests in order to
          save state changes to disk (<rdar://problem/28690656>)
-       - Fixed some localization issues on macOS.
+       - Fixed some localization issues on macOS (<rdar://problem/27245567>)
 
 
 CHANGES IN CUPS V2.2.2
index e74147cd839a48a077f938548e13a78fa0861916..ed75bf86b521a6756924adeae6b27658e95c15aa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PPD localization routines for CUPS.
  *
- * Copyright 2007-2016 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -665,7 +665,7 @@ _ppdLocalizedAttr(ppd_file_t *ppd,  /* I - PPD file */
    /*
     * <rdar://problem/22130168>
     *
-    * Hong Kong locale needs special handling...  Sigh...
+    * Multiple locales need special handling...  Sigh...
     */
 
     if (!strcmp(ll_CC, "zh_HK"))
index 63d5dd2feb8c165ec28a553680b6287fc387bb9c..5bd839d1a334005f19450bbe0a623ae18a1ba4d1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PPD file routines for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -579,12 +579,28 @@ _ppdOpen(
 
    /*
     * <rdar://problem/22130168>
+    * <rdar://problem/27245567>
     *
     * Need to use a different base language for some locales...
     */
 
     if (!strcmp(lang->language, "zh_HK"))
-      strlcpy(ll, "zh_TW.", sizeof(ll));
+    {                                  /* Traditional Chinese + variants */
+      strlcpy(ll_CC, "zh_TW.", sizeof(ll_CC));
+      strlcpy(ll, "zh_", sizeof(ll));
+    }
+    else if (!strncmp(lang->language, "zh", 2))
+      strlcpy(ll, "zh_", sizeof(ll));  /* Any Chinese variant */
+    else if (!strncmp(lang->language, "jp", 2))
+    {                                  /* Any Japanese variant */
+      strlcpy(ll_CC, "ja", sizeof(ll_CC));
+      strlcpy(ll, "jp", sizeof(ll));
+    }
+    else if (!strncmp(lang->language, "nb", 2) || !strncmp(lang->language, "no", 2))
+    {                                  /* Any Norwegian variant */
+      strlcpy(ll_CC, "nb", sizeof(ll_CC));
+      strlcpy(ll, "no", sizeof(ll));
+    }
     else
       snprintf(ll, sizeof(ll), "%2.2s.", lang->language);