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

Function cups_message_load

cups/language.c:1431–1469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1429 */
1430
1431static void
1432cups_message_load(cups_lang_t *lang) /* I - Language */
1433{
1434 char filename[1024]; /* Filename for language locale file */
1435 _cups_globals_t *cg = _cupsGlobals();
1436 /* Pointer to library globals */
1437
1438
1439 snprintf(filename, sizeof(filename), "%s/%s/cups_%s.po", cg->localedir,
1440 lang->language, lang->language);
1441
1442 if (strchr(lang->language, '_') && access(filename, 0))
1443 {
1444 /*
1445 * Country localization not available, look for generic localization...
1446 */
1447
1448 snprintf(filename, sizeof(filename), "%s/%.2s/cups_%.2s.po", cg->localedir,
1449 lang->language, lang->language);
1450
1451 if (access(filename, 0))
1452 {
1453 /*
1454 * No generic localization, so use POSIX...
1455 */
1456
1457 DEBUG_printf(("4cups_message_load: access(\"%s\", 0): %s", filename,
1458 strerror(errno)));
1459
1460 snprintf(filename, sizeof(filename), "%s/C/cups_C.po", cg->localedir);
1461 }
1462 }
1463
1464 /*
1465 * Read the strings from the file...
1466 */
1467
1468 lang->strings = _cupsMessageLoad(filename, _CUPS_MESSAGE_UNQUOTE);
1469}
1470
1471
1472/*

Callers 1

_cupsLangStringFunction · 0.85

Calls 2

_cupsGlobalsFunction · 0.85
_cupsMessageLoadFunction · 0.85

Tested by

no test coverage detected