Skip to content

Commit 05d8055

Browse files
committed
Update translation guide.
1 parent c38a24a commit 05d8055

1 file changed

Lines changed: 20 additions & 24 deletions

File tree

doc/help/translation.html

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<H1 CLASS="title">Translating and Customizing CUPS</H1>
1010

11-
<P>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.</P>
11+
<P>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. The CUPS project also uses <a href="https://hosted.weblate.org" target="_blank">Weblate</a> for basic localization of the message catalogs.</P>
1212

1313

1414
<H2 CLASS="title" ID="INTRO">Getting Started</H2>
@@ -17,27 +17,25 @@ <H2 CLASS="title" ID="INTRO">Getting Started</H2>
1717

1818
<UL>
1919

20-
<LI><VAR>desktop/cups.desktop</VAR> - the GNOME/KDE desktop file pointing to the CUPS web interface</LI>
21-
22-
<LI><VAR>doc/index.html.in</VAR> - the web interface home page</LI>
20+
<LI><VAR>desktop/cups.desktop{.in}</VAR> - the GNOME/KDE desktop file pointing to the CUPS web interface</LI>
2321

2422
<LI><VAR>locale/cups.pot</VAR> - the message catalog</LI>
2523

26-
<LI><VAR>templates/*.tmpl</VAR> and <VAR>templates/header.tmpl.in</VAR> - the web interface template files</LI>
24+
<LI><VAR>templates/*.tmpl</VAR> - the web interface template files</LI>
2725

2826
</UL>
2927

30-
<P>With the exception of the message catalogs and desktop file, localization files are placed in subdirectories under the <VAR>doc</VAR> and <VAR>templates</VAR> using the locale name. Locale names are either <VAR>ll</VAR> or <VAR>ll_CC</VAR>, where "ll" is the 2-letter language code and "CC" is the 2-letter country code. <em>CUPS does not currently use or support the newer <VAR>ll-region</VAR> syntax for locale names.</em></P>
28+
<P>With the exception of the message catalogs and desktop file, localization files are placed in subdirectories under the <VAR>doc</VAR> and <VAR>templates</VAR> using the locale name. Locale names are either <VAR>ll</VAR> or <VAR>ll_CC</VAR>, where "ll" is the 2-letter ISO language code and "CC" is the 2-letter ISO country code. <strong>Note:</strong> CUPS does not currently use or support the newer <VAR>ll-region</VAR> syntax for locale names.</P>
3129

3230
<P>All non-image files must be encoded using the UTF-8 character set.</P>
3331

3432

3533
<H2 CLASS="title" ID="SUBMIT">Submitting a Translation for CUPS</H2>
3634

37-
<P>To submit a translation for inclusion in CUPS, translate the desktop file, all of the template files, the <VAR>index.html.in</VAR> file, and the message catalog. Place these files in the correct subdirectories in the CUPS source code archive and run the following command to create an archive with your files:</P>
35+
<P>To submit a translation for inclusion in CUPS, translate the desktop file, all of the template files, and the message catalog. Place these files in the correct subdirectories in the CUPS source code archive and run the following command to create an archive with your files:</P>
3836

3937
<PRE CLASS="command">
40-
tar cvf <I>ll_CC</I>.tar.gz desktop/cups.desktop doc/<I>ll_CC</I> locale/cups_<I>ll_CC</I>.po templates/<I>ll_CC</I>
38+
tar cvf <I>ll_CC</I>.tar.gz desktop/cups.desktop locale/cups_<I>ll_CC</I>.po templates/<I>ll_CC</I>
4139
</PRE>
4240

4341
<P>Replace "ll_CC" with the locale name for your translation. Once you have created the archive, go to the <A HREF="https://github.com/apple/cups" TARGET="_blank">CUPS project page</A> and submit a bug report, attaching the translation to the report.</P>
@@ -55,11 +53,6 @@ <H2 CLASS="title" ID="DESKTOP">The Desktop File</H2>
5553
</PRE>
5654

5755

58-
<H2 CLASS="title" ID="HOMEPAGE">The Home Page</H2>
59-
60-
<P>The <VAR>index.html.in</VAR> file is a complete HTML file that is displayed when the user visits "http://localhost:631/". Edit the existing <VAR>doc/index.html.in</VAR> and save it in the <VAR>doc/ll_CC</VAR> subdirectory so that the configure script can generate it. After configuring, run "make install" in the <VAR>doc</VAR> subdirectory to test the new home page.</P>
61-
62-
6356
<H2 CLASS="title" ID="CATALOGS">Message Catalogs</H2>
6457

6558
<P>CUPS message catalogs are GNU gettext ".po" text files that provide a list of localized message strings for the CUPS software. Message catalogs are named <VAR>cups_ll.po</VAR> or <VAR>cups_ll_CC.po</VAR>, where "ll" is the standard 2-letter abbreviation for the language and "CC" is the standard 2-letter abbreviation for the country.</P>
@@ -91,14 +84,7 @@ <H2 CLASS="title" ID="TEMPLATES">Template Files</H2>
9184

9285
<P>Template files are HTML files with special formatting characters in them that allow substitution of variables and arrays. The CUPS CGI programs (<CODE>admin.cgi</CODE>, <CODE>classes.cgi</CODE>, <CODE>help.cgi</CODE>, <CODE>jobs.cgi</CODE>, and <CODE>printers.cgi</CODE>) use these template file to provide dynamic content for the web interface. Template files are installed in the <VAR>/usr/share/cups/templates</VAR> directory by default. <A HREF="table1">Table 1</a> lists the various template files and their purpose.</P>
9386

94-
<P>Translated versions of the template files should be saved in
95-
the <VAR>templates/ll_CC</VAR> subdirectory. For example,
96-
Canadian French template files should be saved in the
97-
<VAR>templates/fr_CA</VAR> subdirectory. After you have
98-
translated all of the templates, add the locale to the
99-
<CODE>LANGUAGES</CODE> variable in the
100-
<VAR>Makedefs</VAR> file and run "make install" in the
101-
<VAR>templates</VAR> subdirectory to test the translation.</P>
87+
<P>Translated versions of the template files should be saved in the <VAR>templates/ll_CC</VAR> subdirectory. For example, Canadian French template files should be saved in the <VAR>templates/fr_CA</VAR> subdirectory. After you have translated all of the templates, add the locale to the <CODE>LANGUAGES</CODE> variable in the <VAR>Makedefs</VAR> file and run "make install" in the <VAR>templates</VAR> subdirectory to test the translation.</P>
10288

10389
<DIV CLASS="table"><TABLE ID="table1" SUMMARY="Web Interface Template Files">
10490
<CAPTION>Table 1: Web Interface Template Files</CAPTION>
@@ -190,8 +176,8 @@ <H2 CLASS="title" ID="TEMPLATES">Template Files</H2>
190176
<TD>This is the "unknown operation" error page.</TD>
191177
</TR>
192178
<TR>
193-
<TD>header.tmpl(.in)</TD>
194-
<TD>This template is used as the standard header on all dynamic content. Edit the <VAR>header.tmpl.in</VAR> file and let the configure script generate the <VAR>header.tmpl</VAR> file.</TD>
179+
<TD>header.tmpl</TD>
180+
<TD>This template is used as the standard header.</TD>
195181
</TR>
196182
<TR>
197183
<TD>help-header.tmpl</TD>
@@ -205,6 +191,10 @@ <H2 CLASS="title" ID="TEMPLATES">Template Files</H2>
205191
<TD>help-trailer.tmpl</TD>
206192
<TD>This is the bottom part of the help page.</TD>
207193
</TR>
194+
<TR>
195+
<TD>home.tmpl</TD>
196+
<TD>This is the main home page.</TD>
197+
</TR>
208198
<TR>
209199
<TD>job-cancel.tmpl</TD>
210200
<TD>This template shows "job canceled".</TD>
@@ -472,13 +462,14 @@ <H4 ID="LOCTMPL">What to Localize in a Template File</H4>
472462

473463
<H3 ID="CGI">CGI Programs</H3>
474464

475-
<P>CUPS uses five CGI programs to manage the dynamic web interfaces:</P>
465+
<P>CUPS uses six CGI programs to manage the dynamic web interfaces:</P>
476466

477467
<UL>
478468

479469
<LI><CODE>admin.cgi</CODE></LI>
480470
<LI><CODE>classes.cgi</CODE></LI>
481471
<LI><CODE>help.cgi</CODE></LI>
472+
<LI><CODE>home.cgi</CODE></LI>
482473
<LI><CODE>jobs.cgi</CODE></LI>
483474
<LI><CODE>printers.cgi</CODE></LI>
484475

@@ -631,6 +622,11 @@ <H4 ID="help.cgi">help.cgi</H4>
631622
<P>The <CODE>help.cgi</CODE> program handles all of the on-line help functions and is run for all direct accesses to the <VAR>/help</VAR> resource.</P>
632623

633624

625+
<H4 ID="home.cgi">home.cgi</H4>
626+
627+
<P>The <CODE>home.cgi</CODE> program handles the home page and OAuth login/logout functions and is run for all direct accesses to the <VAR>/</VAR> resource.
628+
629+
634630
<H4 ID="jobs.cgi">jobs.cgi</H4>
635631

636632
<P>The <CODE>jobs.cgi</CODE> program handles all of the job functions and is run for all direct accesses to the <VAR>/jobs</VAR> resource. For most operations it uses the <CODE>JOB_ID</CODE>, <CODE>OP</CODE>, and <CODE>WHICH_JOBS</CODE> form variables to specify the action requested. <A HREF="#table6">Table 6</A> shows the supported <CODE>OP</CODE> values.</P>

0 commit comments

Comments
 (0)