]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
<rdar://problem/22130168> [PrintCenter]: HK: Gala15A250: Many strings are not localiz...
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 6 Aug 2015 13:56:32 +0000 (13:56 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 6 Aug 2015 13:56:32 +0000 (13:56 +0000)
Need to use zh_TW as a fallback for zh_HK.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12834 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES.txt
cups/language.c
cups/localize.c

index e9f789233217390154539778da72ceac59048f75..41cefefc757fbca9b48540233c8cea4ecca7fbaa 100644 (file)
@@ -1,8 +1,10 @@
-CHANGES.txt - 2.1.0 - 2015-08-05
+CHANGES.txt - 2.1.0 - 2015-08-06
 --------------------------------
 
 CHANGES IN CUPS V2.1.0
 
+       - The new Hong Kong Chinese locale did not correctly use Taiwan Chinese
+         as a fallback (<rdar://problem/22130168>)
        - "make check" incorrectly reported an expectation of 18 warning
          messages when 8 were expected (STR #4684)
 
index aea85657a26113bf1d63e40871171b8d38eb7ac5..de6fdeabda9c859c5e28d628c61fee22ea517b34 100644 (file)
@@ -1346,6 +1346,19 @@ appleMessageLoad(const char *locale)     /* I - Locale ID */
       locale = "Japanese";
     else if (!strncmp(locale, "es", 2))
       locale = "Spanish";
+    else if (!strcmp(locale, "zh_HK"))
+    {
+     /*
+      * <rdar://problem/22130168>
+      *
+      * Try zh_TW first, then zh...  Sigh...
+      */
+
+      if (!access(CUPS_BUNDLEDIR "/Resources/zh_TW.lproj/cups.strings", 0))
+        locale = "zh_TW";
+      else
+        locale = "zh";
+    }
     else if (strstr(locale, "_") != NULL || strstr(locale, "-") != NULL)
     {
      /*
index 1bf75ec70424a99233bfe55558434e5205b37b55..9f837b87ee47564e3e389011ac6df0d9bde7aa04 100644 (file)
@@ -3,7 +3,7 @@
  *
  * PPD localization routines for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2015 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -664,8 +664,23 @@ _ppdLocalizedAttr(ppd_file_t *ppd, /* I - PPD file */
   snprintf(lkeyword, sizeof(lkeyword), "%s.%s", ll_CC, keyword);
   if ((attr = ppdFindAttr(ppd, lkeyword, spec)) == NULL)
   {
-    snprintf(lkeyword, sizeof(lkeyword), "%2.2s.%s", ll_CC, keyword);
-    attr = ppdFindAttr(ppd, lkeyword, spec);
+   /*
+    * <rdar://problem/22130168>
+    *
+    * Hong Kong locale needs special handling...  Sigh...
+    */
+
+    if (!strcmp(ll_CC, "zh_HK"))
+    {
+      snprintf(lkeyword, sizeof(lkeyword), "zh_TW.%s", keyword);
+      attr = ppdFindAttr(ppd, lkeyword, spec);
+    }
+
+    if (!attr)
+    {
+      snprintf(lkeyword, sizeof(lkeyword), "%2.2s.%s", ll_CC, keyword);
+      attr = ppdFindAttr(ppd, lkeyword, spec);
+    }
 
     if (!attr)
     {