Thanks to its extensive use of templates, images, and message catalogs, CUPS can be easily translated (or customized!) to suit your needs. This help file will guide you through the CUPS localization files so you can get the most out of it.

Getting Started

Start by downloading the CUPS source code from www.cups.org. After you extract the files from the source archive, you will want to copy the following files and directories:

With the exception of the message catalogs and desktop file, localization files are placed in subdirectories under the doc and templates using the locale name. Locale names are either ll or ll_CC, where "ll" is the 2-letter language code and "CC" is the 2-letter country code.

All non-image files must be encoded using the UTF-8 character set.

Submitting a Translation for CUPS

To submit a translation for inclusion in CUPS, translate the desktop file, all of the button images, template files, the index.html.in file, and the message catalog. Place these files in the correct subdirectory in the CUPS source code archive and run the following command to create an archive with your files:

tar cvf ll_CC.tar.gz desktop/cups.desktop doc/ll_CC \
    locale/cups_ll_CC.po templates/ll_CC

Replace "ll_CC" with the locale name for your translation. Once you have created the archive, go to the CUPS Bugs & Features page and submit a bug report, attaching the translation to the report.

The Desktop File

The desktop/cups.desktop file provides a link to the CUPS web interface from desktop environments such as GNOME and KDE. To translate this file, add two lines to the bottom with the Name and Comment keys:

Name[ll_CC]=Translation of "Manage Printing"
Comment[ll_CC]=Translation of "CUPS Web Interface"

Button Images

The web interface button images are used to activate functions on the CUPS web pages. Table 1 lists the button images and the English text labels for those buttons. Use the supplied Gimp scripts to create button images that match the CUPS web interface and save them in the doc/ll_CC/images subdirectory. The Gimp button scripts can be installed using the following command:

cp doc/images/button*.scm ~/.gimp-2.2/scripts

If you have already started the Gimp application, choose Refresh Scripts from the Xtns->Script-Fu sub-menu. The button scripts will be available under a new Btns

When you have created all of the button images, edit the Makedefs file and add the locale name to the LANGUAGES variable. You can then run "make install" in the doc subdirectory to test the translated buttons.

Table 1: Web Interface Buttons
Filename Text
button-accept-jobs.gif Accept Jobs
button-add-class.gif Add Class
button-add-printer.gif Add Printer
button-add-this-printer.gif Add This Printer
button-cancel-all-jobs.gif Cancel All Jobs
button-cancel-job.gif Cancel Job
button-change-settings.gif Change Settings
button-clean-print-heads.gif Clean Print Heads
button-clear.gif Clear
button-continue.gif Continue
button-delete-class.gif Delete Class
button-delete-printer.gif Delete Printer
button-manage-printers.gif Manage Printers
button-modify-printer.gif Modify Printer
button-start-printer.gif Start Printer
button-stop-printer.gif Stop Printer
Table 2: Web Interface Template Files Filename Purpose add-printer.tmpl This is the initial form that is shown to add a new printer. admin.tmpl This is the main administration page. choose-device.tmpl This is the form that shows the list of available devices. error.tmpl This template displays a generic error message. error-op.tmpl This is the "unknown operation" error page. modify-printer.tmpl This template is used as the first form when modifying a printer. printer-accept.tmpl This template shows "printer now accepting jobs". printer-added.tmpl This template shows "printer added". printer-configured.tmpl This template shows "printer configured". printer-confirm.tmpl This template asks the user to confirm the deletion of a printer. printer-default.tmpl This template shows "default printer set". printer-deleted.tmpl This template shows "printer deleted". printer-jobs-header.tmpl This templates shows the "jobs" header for jobs on a printer. printer-modified.tmpl This template shows "printer modified". printer-purge.tmpl This template shows "printer has been purged of all jobs". printer-reject.tmpl This template shows "printer now rejecting jobs". printer-start.tmpl This template shows "printer started". printer-stop.tmpl This template shows "printer stopped". printers.tmpl This template is used to list information on one or more printers. printers-header.tmpl This template shows the "showing printer N of M" header in the printers list.
Table 3: Template Substitution Conditions
Char Condition
? True if variable exists.
= True if variable is equal to value.
! True if variable is not equal to value.
< True if variable is less than value.
> True if variable is greater than value.

CGI Programs

CUPS uses five CGI programs to manage the dynamic web interfaces:

Each CGI program accepts standard form variables such as OP for the operation to perform, PRINTER_NAME for the printer or class name to operate on, QUERY for any search words, FIRST for the first class, job, or printer to display, and ORDER to control the order that classes, jobs, or printers are displayed.

In addition, the classes.cgi, jobs.cgi, and printers.cgi programs support a WHICH_JOBS variable to control which jobs are displayed. Table 4 lists the supported values.

Table 4: WHICH_JOBS Values
OP Value Description
all Show all jobs
completed Show completed jobs
not-completed Show active jobs

admin.cgi

The admin.cgi program handles all of the printer and class administration functions and is run for all direct accesses to the /admin resource. For most operations it uses the PRINTER_NAME and OP form variables to specify the action requested. Table 5 shows the supported OP values.

Table 5: admin.cgi OP Values
OP Value Description
add-printer Adds a new printer.
delete-printer Deletes a printer. The form variable CONFIRM may be set to any value to bypass the confirmation page.
modify-printer Modifies a printer.
start-printer Starts the named printer.
stop-printer Stops the named printer.

printers.cgi

The printers.cgi program is responsible for listing printer information, including jobs destined for that printer. It is for all direct accesses to the /printers resource and supports the optional form variables OP and WHICH_JOBS. If no form variables are supplied then the CGI lists all printers or a specific printer and the active jobs on that printer. Table 8 shows the supported OP values.

Table 8: printers.cgi OP Values
OP Value Description
clean-print-heads Clean the print heads.
move-jobs Move all jobs to a different destination.
print-self-test-page Print a printer self-test page.
print-test-page Print a PostScript test page.