| 5446 | */ |
| 5447 | |
| 5448 | static void |
| 5449 | ppd_put_string(cups_file_t *fp, /* I - PPD file */ |
| 5450 | cups_lang_t *lang, /* I - Language */ |
| 5451 | cups_array_t *strings, /* I - Strings */ |
| 5452 | const char *ppd_option,/* I - PPD option */ |
| 5453 | const char *ppd_choice,/* I - PPD choice */ |
| 5454 | const char *pwg_msgid) /* I - PWG message ID */ |
| 5455 | { |
| 5456 | const char *text; /* Localized text */ |
| 5457 | |
| 5458 | |
| 5459 | if ((text = _cupsLangString(lang, pwg_msgid)) == pwg_msgid || !strcmp(pwg_msgid, text)) |
| 5460 | { |
| 5461 | if ((text = _cupsMessageLookup(strings, pwg_msgid)) == pwg_msgid) |
| 5462 | return; |
| 5463 | } |
| 5464 | |
| 5465 | // Add the first line of localized text... |
| 5466 | cupsFilePrintf(fp, "*%s.%s %s/", lang->language, ppd_option, ppd_choice); |
| 5467 | while (*text && *text != '\n') |
| 5468 | { |
| 5469 | // Escape ":" and "<"... |
| 5470 | if (*text == ':' || *text == '<') |
| 5471 | cupsFilePrintf(fp, "<%02X>", *text); |
| 5472 | else |
| 5473 | cupsFilePutChar(fp, *text); |
| 5474 | |
| 5475 | text ++; |
| 5476 | } |
| 5477 | cupsFilePuts(fp, ": \"\"\n"); |
| 5478 | } |
| 5479 | |
| 5480 | |
| 5481 | /* |
no test coverage detected