| 230 | */ |
| 231 | |
| 232 | const char * /* O - Localized string */ |
| 233 | cupsLocalizeDestOption( |
| 234 | http_t *http, /* I - Connection to destination */ |
| 235 | cups_dest_t *dest, /* I - Destination */ |
| 236 | cups_dinfo_t *dinfo, /* I - Destination information */ |
| 237 | const char *option) /* I - Option to localize */ |
| 238 | { |
| 239 | _cups_message_t key, /* Search key */ |
| 240 | *match; /* Matching entry */ |
| 241 | const char *localized; /* Localized string */ |
| 242 | |
| 243 | |
| 244 | DEBUG_printf(("cupsLocalizeDestOption(http=%p, dest=%p, dinfo=%p, option=\"%s\")", (void *)http, (void *)dest, (void *)dinfo, option)); |
| 245 | |
| 246 | if (!http || !dest || !dinfo) |
| 247 | return (option); |
| 248 | |
| 249 | if (!dinfo->localizations) |
| 250 | cups_create_localizations(http, dinfo); |
| 251 | |
| 252 | key.msg = (char *)option; |
| 253 | if ((match = (_cups_message_t *)cupsArrayFind(dinfo->localizations, &key)) != NULL) |
| 254 | return (match->str); |
| 255 | else if ((localized = _cupsLangString(cupsLangDefault(), option)) != NULL) |
| 256 | return (localized); |
| 257 | else |
| 258 | return (option); |
| 259 | } |
| 260 | |
| 261 | |
| 262 | /* |