From: msweet Date: Thu, 6 Aug 2015 13:56:32 +0000 (+0000) Subject: [PrintCenter]: HK: Gala15A250: Many strings are not localiz... X-Git-Tag: v2.2b1~214 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd3e2e22b9bf481c39b9b994beb72342deee6b98;p=thirdparty%2Fcups.git [PrintCenter]: HK: Gala15A250: Many strings are not localized in printer setting pane for HK. 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 --- diff --git a/CHANGES.txt b/CHANGES.txt index e9f7892332..41cefefc75 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 () - "make check" incorrectly reported an expectation of 18 warning messages when 8 were expected (STR #4684) diff --git a/cups/language.c b/cups/language.c index aea85657a2..de6fdeabda 100644 --- a/cups/language.c +++ b/cups/language.c @@ -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")) + { + /* + * + * + * 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) { /* diff --git a/cups/localize.c b/cups/localize.c index 1bf75ec704..9f837b87ee 100644 --- a/cups/localize.c +++ b/cups/localize.c @@ -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); + /* + * + * + * 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) {