| 684 | */ |
| 685 | |
| 686 | static cups_lang_t * /* O - Current language */ |
| 687 | ppd_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 | } |
no test coverage detected