You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/help/translation.html
+20-24Lines changed: 20 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
<H1CLASS="title">Translating and Customizing CUPS</H1>
10
10
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 <ahref="https://hosted.weblate.org" target="_blank">Weblate</a> for basic localization of the message catalogs.</P>
<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>
23
21
24
22
<LI><VAR>locale/cups.pot</VAR> - the message catalog</LI>
25
23
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>
27
25
28
26
</UL>
29
27
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>
31
29
32
30
<P>All non-image files must be encoded using the UTF-8 character set.</P>
33
31
34
32
35
33
<H2CLASS="title" ID="SUBMIT">Submitting a Translation for CUPS</H2>
36
34
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>
38
36
39
37
<PRECLASS="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>
41
39
</PRE>
42
40
43
41
<P>Replace "ll_CC" with the locale name for your translation. Once you have created the archive, go to the <AHREF="https://github.com/apple/cups" TARGET="_blank">CUPS project page</A> and submit a bug report, attaching the translation to the report.</P>
<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>
<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>
<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. <AHREF="table1">Table 1</a> lists the various template files and their purpose.</P>
93
86
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>
<TD>This is the "unknown operation" error page.</TD>
191
177
</TR>
192
178
<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>
<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>
632
623
633
624
625
+
<H4ID="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
+
634
630
<H4ID="jobs.cgi">jobs.cgi</H4>
635
631
636
632
<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. <AHREF="#table6">Table 6</A> shows the supported <CODE>OP</CODE> values.</P>
0 commit comments