/*
* 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
/*
* <rdar://problem/22130168>
*
- * Hong Kong locale needs special handling... Sigh...
+ * Multiple locales need special handling... Sigh...
*/
if (!strcmp(ll_CC, "zh_HK"))
/*
* 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
/*
* <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);