cups icon indicating copy to clipboard operation
cups copied to clipboard

Support retrieving localizations from PPDs with cupsLocalizeDestValue()

Open Plombo opened this issue 3 years ago • 2 comments

The first commit in this pull request makes cupsd include "printer-strings-uri" when listing its supported printer attributes. This makes the cupsLocalize* functions work when connected to the CUPS server (rather than directly to a printer). As a convenient side effect, it also makes ippeveprinter properly advertise the attribute.

The second commit updates .strings file creation to use localized names from PPDs when available for values of the "media-type", "media-source", "output-bin", and "finishing-template" attributes. This allows clients to retrieve localized names for these attributes using cupsLocalizeDestValue() instead of the legacy PPD API. I've only tested it with "media-type", but the other three should work as well.

Plombo avatar Nov 17 '22 19:11 Plombo

Upon further investigation, I think I was wrong about the cupsLocalize* functions needing the first commit in this pull request, but I wasn't wrong about ippeveprinter needing it. Given that the performance/memory concerns seem to be limited to the second commit (the one involving PPD localizations), it probably makes sense to split the first one out into its own pull request (which could be merged sooner) and let this one be dedicated to the second. I'll get going on that.

Plombo avatar Nov 18 '22 19:11 Plombo

I've now done the above, splitting the first commit into a separate pull request (#551). I also updated the PPD localization commit to use _PPD_LOCALIZATION_DEFAULT instead of _PPD_LOCALIZATION_ALL.

Plombo avatar Nov 18 '22 20:11 Plombo

Yeah, we will need to do this a different way... I'm looking at creating a single set of localizations for all printers so that we can just serve up those instead of doing separate files per-printer.

michaelrsweet avatar Apr 06 '24 14:04 michaelrsweet