Home | History | Annotate | Download | only in cups

Lines Matching refs:language

2  * I18N/language support for CUPS.
41 /* Language string cache */
116 const char * const language; /* Language ID */
121 { /* Language to locale ID LUT */
162 * '_cupsAppleLanguage()' - Get the Apple language identifier associated with a
166 const char * /* O - Language ID */
168 char *language,/* I - Language ID buffer */
169 size_t langsize) /* I - Size of language ID buffer */
173 langid; /* CF language identifier */
188 strlcpy(language, "en", langsize);
192 strlcpy(language, locale, langsize);
196 strlcpy(language, locale, langsize);
198 if (language[2] == '-')
204 language[2] = '_';
205 language[3] = (char)toupper(language[3] & 255);
206 language[4] = (char)toupper(language[4] & 255);
217 strlcpy(language, apple_language_locale[i].language, sizeof(language));
222 * Attempt to map the locale ID to a language ID...
225 if ((localeid = CFStringCreateWithCString(kCFAllocatorDefault, language,
231 CFStringGetCString(langid, language, (CFIndex)langsize, kCFStringEncodingASCII);
242 return (language);
247 * '_cupsAppleLocale()' - Get the locale associated with an Apple language ID.
251 _cupsAppleLocale(CFStringRef languageName, /* I - Apple language ID */
273 * Map new language identifiers to locales...
281 if (!strcmp(locale, apple_language_locale[i].language))
291 * Just try the Apple language name...
302 * Convert language subtag into region subtag...
342 * 'cupsLangDefault()' - Return the default language.
345 cups_lang_t * /* O - Language data */
354 * for the given language.
358 cupsLangEncoding(cups_lang_t *lang) /* I - Language data */
368 * 'cupsLangFlush()' - Flush all language data out of the cache.
374 cups_lang_t *lang, /* Current language */
375 *next; /* Next language */
393 * Then free the language structure itself...
407 * 'cupsLangFree()' - Free language data.
413 cupsLangFree(cups_lang_t *lang) /* I - Language to free */
425 * 'cupsLangGet()' - Get a language.
428 cups_lang_t * /* O - Language data */
429 cupsLangGet(const char *language) /* I - Language or locale */
435 char langname[16], /* Requested language name */
439 *ptr, /* Pointer into language/charset */
440 real[48]; /* Real language name */
442 cups_lang_t *lang; /* Current language... */
486 DEBUG_printf(("2cupsLangGet(language=\"%s\")", language));
500 if (!language)
502 if (!getenv("SOFTWARE") || (language = getenv("LANG")) == NULL)
503 language = appleLangDefault();
505 DEBUG_printf(("4cupsLangGet: language=\"%s\"", language));
521 if (!language)
573 language = locale;
582 DEBUG_printf(("4cupsLangGet: new language value is \"%s\"", language));
588 * If "language" is NULL at this point, then chances are we are using
589 * a language that is not installed for the base OS.
592 if (!language)
598 language = "C";
632 * Parse the language string passed in to a locale string. "C" is the
634 * language string is converted from ll-cc[.charset] (language-country)
636 * POSIX-compliant operating systems. Invalid language names are mapped
642 if (language == NULL || !language[0] ||
643 !strcmp(language, "POSIX"))
651 for (ptr = langname; *language; language ++)
652 if (*language == '_' || *language == '-' || *language == '.')
655 *ptr++ = (char)tolower(*language & 255);
659 if (*language == '_' || *language == '-')
665 for (language ++, ptr = country; *language; language ++)
666 if (*language == '.')
669 *ptr++ = (char)toupper(*language & 255);
674 if (*language == '.' && !charset[0])
680 for (language ++, ptr = charset; *language; language ++)
681 language) && ptr < (charset + sizeof(charset) - 1))
682 *ptr++ = (char)toupper(*language & 255);
688 * Force a POSIX locale for an invalid language name...
742 * See if we already have this language/country loaded...
762 * See if there is a free language available; if so, use that
773 * Allocate memory for the language and add it to the cache.
797 * Then assign the language and encoding fields...
801 strlcpy(lang->language, real, sizeof(lang->language));
822 * convert the string to the language encoding.
826 _cupsLangString(cups_lang_t *lang, /* I - Language */
1224 if (!cg->language[0])
1229 strlcpy(cg->language, lang, sizeof(cg->language));
1230 return (cg->language);
1297 if (_cupsAppleLocale(languageName, cg->language, sizeof(cg->language)))
1298 DEBUG_printf(("3appleLangDefault: cg->language=\"%s\"",
1299 cg->language));
1309 * If we didn't find the language, default to en_US...
1312 if (!cg->language[0])
1315 strlcpy(cg->language, "en_US.UTF-8", sizeof(cg->language));
1319 DEBUG_printf(("3appleLangDefault: Using previous locale \"%s\".", cg->language));
1325 return (cg->language);
1338 applelang[256], /* Apple language ID */
1339 baselang[3]; /* Base language */
1374 * Try with just the language code...
1422 * Drop country code, just try language...
1501 * 'cups_cache_lookup()' - Lookup a language in the cache...
1504 static cups_lang_t * /* O - Language data or NULL */
1509 cups_lang_t *lang; /* Current language */
1522 DEBUG_printf(("9cups_cache_lookup: lang=%p, language=\"%s\", "
1523 "encoding=%d(%s)", (void *)lang, lang->language, lang->encoding,
1526 if (!strcmp(lang->language, name) &&
1574 * 'cups_message_load()' - Load the message catalog for a language.
1578 cups_message_load(cups_lang_t *lang) /* I - Language */
1581 lang->strings = appleMessageLoad(lang->language);
1584 char filename[1024]; /* Filename for language locale file */
1590 lang->language, lang->language);
1592 if (strchr(lang->language, '_') && access(filename, 0))
1599 lang->language, lang->language);