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

Function cupsLocalizeDestOption

cups/dest-localization.c:232–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230 */
231
232const char * /* O - Localized string */
233cupsLocalizeDestOption(
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/*

Callers 3

localizeFunction · 0.85
show_supportedFunction · 0.85
show_supportedFunction · 0.85

Calls 4

cupsArrayFindFunction · 0.85
_cupsLangStringFunction · 0.85
cupsLangDefaultFunction · 0.85

Tested by 3

localizeFunction · 0.68
show_supportedFunction · 0.68
show_supportedFunction · 0.68