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.
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.
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/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"
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.
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 |
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. |
CUPS uses five CGI programs to manage the dynamic web interfaces:
admin.cgi
printers.cgi
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.
OP Value | Description |
---|---|
all | Show all jobs |
completed | Show completed jobs |
not-completed | Show active jobs |
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.
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. |
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.
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. |