]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ppd.c
Fix some more localization issues on macOS (<rdar://problem/27245567>)
[thirdparty/cups.git] / cups / ppd.c
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);