Lines Matching refs:locale

39  * fmd_msg_locale_set - set the default locale (initially based on environ(5))
40 * fmd_msg_locale_get - get the default locale
66 * the corresponding locale directories. The values for the message items are
86 * the process locale and potentially alter text domain bindings. At present,
98 #include <locale.h>
122 char *fmh_locale; /* default program locale from environment */
298 * Initialize the program's locale from the environment if it hasn't
312 * usr/lib/locale into <rootdir>/usr/lib/locale, but handles all of the
320 s = "/usr/lib/locale"; /* substitute default */
332 * messages, even for the C locale. We therefore want to use dgettext
333 * for all message lookups, but its defined behavior in the C locale is
344 * Cache the message template for the current locale. This is the
346 * If the lookup fails for the current locale, fall back to the C locale
347 * and try again. Then restore the original locale.
372 fmd_msg_locale_set(fmd_msg_hdl_t *h, const char *locale)
376 if (locale == NULL) {
381 if ((l = strdup(locale)) == NULL) {
798 * non-C locale, but this code needs to always operate on C characters.
1368 const char *locale, nvlist_t *nvl, const char *code, fmd_msg_item_t item)
1380 if (locale != NULL && strcmp(h->fmh_locale, locale) == 0)
1381 locale = NULL; /* simplify later tests */
1408 * Save the current locale string, and if we've been asked to fetch
1409 * the text for a different locale, switch locales now under the lock.
1414 if (locale != NULL)
1415 (void) setlocale(LC_ALL, locale);
1419 * default locale, attempt to fall back to the C locale for this code.
1422 (locale != NULL || strcmp(h->fmh_locale, "C") != 0)) {
1424 locale = "C"; /* restore locale */
1435 if (locale != NULL)
1451 const char *locale, nvlist_t *nvl, fmd_msg_item_t item)
1465 return (fmd_msg_getitem(h, locale, nvl, code, item));
1470 const char *locale, const char *code, fmd_msg_item_t item)
1477 return (fmd_msg_getitem(h, locale, NULL, code, item));
1482 const char *locale, const char *dict, const char *key)
1500 * Save the current locale string, and if we've been asked to fetch
1501 * the text for a different locale, switch locales now under the lock.
1507 if (locale != NULL)
1508 (void) setlocale(LC_ALL, locale);
1511 * First attempt to fetch the string in the current locale. If this
1512 * fails and we're in a non-default locale, attempt to fall back to the
1513 * C locale and try again. If it still fails then we return NULL and
1517 (locale != NULL || strcmp(h->fmh_locale, "C") != 0)) {
1519 locale = "C"; /* restore locale */
1526 if (locale != NULL)
1543 const char *locale, nvlist_t *nvl, const char *code)
1555 if (locale != NULL && strcmp(h->fmh_locale, locale) == 0)
1556 locale = NULL; /* simplify later tests */
1583 * Save the current locale string, and if we've been asked to fetch
1584 * the text for a different locale, switch locales now under the lock.
1589 if (locale != NULL)
1590 (void) setlocale(LC_ALL, locale);
1594 * default locale, attempt to fall back to the C locale for this code.
1597 (locale != NULL || strcmp(h->fmh_locale, "C") != 0)) {
1599 locale = "C"; /* restore locale */
1610 if (locale != NULL)
1625 fmd_msg_gettext_nv(fmd_msg_hdl_t *h, const char *locale, nvlist_t *nvl)
1634 return (fmd_msg_gettext(h, locale, nvl, code));
1638 fmd_msg_gettext_id(fmd_msg_hdl_t *h, const char *locale, const char *code)
1640 return (fmd_msg_gettext(h, locale, NULL, code));