MCPcopy Create free account
hub / github.com/OpenPrinting/cups / ppd_ll_CC

Function ppd_ll_CC

cups/ppd-localize.c:686–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

684 */
685
686static cups_lang_t * /* O - Current language */
687ppd_ll_CC(char *ll_CC, /* O - Country-specific locale name */
688 size_t ll_CC_size) /* I - Size of country-specific name */
689{
690 cups_lang_t *lang; /* Current language */
691
692
693 /*
694 * Get the current locale...
695 */
696
697 if ((lang = cupsLangDefault()) == NULL)
698 {
699 strlcpy(ll_CC, "en_US", ll_CC_size);
700 return (NULL);
701 }
702
703 /*
704 * Copy the locale name...
705 */
706
707 strlcpy(ll_CC, lang->language, ll_CC_size);
708
709 if (strlen(ll_CC) == 2)
710 {
711 /*
712 * Map "ll" to primary/origin country locales to have the best
713 * chance of finding a match...
714 */
715
716 if (!strcmp(ll_CC, "cs"))
717 strlcpy(ll_CC, "cs_CZ", ll_CC_size);
718 else if (!strcmp(ll_CC, "en"))
719 strlcpy(ll_CC, "en_US", ll_CC_size);
720 else if (!strcmp(ll_CC, "ja"))
721 strlcpy(ll_CC, "ja_JP", ll_CC_size);
722 else if (!strcmp(ll_CC, "sv"))
723 strlcpy(ll_CC, "sv_SE", ll_CC_size);
724 else if (!strcmp(ll_CC, "zh")) /* Simplified Chinese */
725 strlcpy(ll_CC, "zh_CN", ll_CC_size);
726 }
727
728 DEBUG_printf(("8ppd_ll_CC: lang->language=\"%s\", ll_CC=\"%s\"...",
729 lang->language, ll_CC));
730 return (lang);
731}

Callers 4

ppdLocalizeFunction · 0.85
ppdLocalizeAttrFunction · 0.85
ppdLocalizeIPPReasonFunction · 0.85
ppdLocalizeMarkerNameFunction · 0.85

Calls 1

cupsLangDefaultFunction · 0.85

Tested by

no test coverage detected