From: msweet Date: Mon, 20 Jul 2015 17:05:06 +0000 (+0000) Subject: Fix Portugeuse localization fallback () X-Git-Tag: v2.2b1~232 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36ac4374edaa576129ccf2751e8b3dc9ddf104e6;p=thirdparty%2Fcups.git Fix Portugeuse localization fallback () git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12790 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/cups/language.c b/cups/language.c index dcc1449305..aea85657a2 100644 --- a/cups/language.c +++ b/cups/language.c @@ -3,7 +3,7 @@ * * I18N/language support for CUPS. * - * Copyright 2007-2014 by Apple Inc. + * Copyright 2007-2015 by Apple Inc. * Copyright 1997-2007 by Easy Software Products. * * These coded instructions, statements, and computer programs are the @@ -1305,7 +1305,8 @@ static cups_array_t * /* O - Message catalog */ appleMessageLoad(const char *locale) /* I - Locale ID */ { char filename[1024], /* Path to cups.strings file */ - applelang[256]; /* Apple language ID */ + applelang[256], /* Apple language ID */ + baselang[3]; /* Base language */ CFURLRef url; /* URL to cups.strings file */ CFReadStreamRef stream = NULL; /* File stream */ CFPropertyListRef plist = NULL; /* Localization file */ @@ -1345,6 +1346,15 @@ appleMessageLoad(const char *locale) /* I - Locale ID */ locale = "Japanese"; else if (!strncmp(locale, "es", 2)) locale = "Spanish"; + else if (strstr(locale, "_") != NULL || strstr(locale, "-") != NULL) + { + /* + * Drop country code, just try language... + */ + + strlcpy(baselang, locale, sizeof(baselang)); + locale = baselang; + } snprintf(filename, sizeof(filename), CUPS_BUNDLEDIR "/Resources/%s.lproj/cups.strings", locale);