diff options
author | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2009-06-10 19:02:58 +0000 |
---|---|---|
committer | msweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be> | 2009-06-10 19:02:58 +0000 |
commit | 97c9a8d72271152cf71373b9c7fbdc6036b92e89 (patch) | |
tree | c5f3bf3b2358f9905597f0f258b244d38ce8d3c0 /filter | |
parent | 393ac6abae820d62982c8ad9c871f3c1cc59568c (diff) |
Import changes from CUPS 1.4svn-r8704.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1556 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'filter')
-rw-r--r-- | filter/Makefile | 5 | ||||
-rw-r--r-- | filter/imagetoraster.c | 6 | ||||
-rw-r--r-- | filter/ppd-compiler.shtml | 73 |
3 files changed, 78 insertions, 6 deletions
diff --git a/filter/Makefile b/filter/Makefile index 2bb7a7f52..6e2e96bd1 100644 --- a/filter/Makefile +++ b/filter/Makefile @@ -164,8 +164,9 @@ install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64) installstatic: $(INSTALL_DIR) -m 755 $(LIBDIR) - $(INSTALL_LIB) libcupsimage.a $(LIBDIR); - $(RANLIB) $(LIBDIR)/libcupsimage.a; + $(INSTALL_LIB) -m 755 libcupsimage.a $(LIBDIR) + $(RANLIB) $(LIBDIR)/libcupsimage.a + $(CHMOD) 555 $(LIBDIR)/libcupsimage.a install32bit: $(INSTALL_DIR) -m 755 $(LIB32DIR) diff --git a/filter/imagetoraster.c b/filter/imagetoraster.c index c57275b7a..16b49707f 100644 --- a/filter/imagetoraster.c +++ b/filter/imagetoraster.c @@ -241,8 +241,7 @@ main(int argc, /* I - Number of command-line arguments */ * Child process for pstoraster... Assign new pipe input to pstoraster... */ - close(0); - dup(mypipes[0]); + dup2(mypipes[0], 0); close(mypipes[0]); close(mypipes[1]); @@ -265,8 +264,7 @@ main(int argc, /* I - Number of command-line arguments */ * Update stdout so it points at the new pstoraster... */ - close(1); - dup(mypipes[1]); + dup2(mypipes[1], 1); close(mypipes[0]); close(mypipes[1]); diff --git a/filter/ppd-compiler.shtml b/filter/ppd-compiler.shtml index 7004e3de7..c98b95cee 100644 --- a/filter/ppd-compiler.shtml +++ b/filter/ppd-compiler.shtml @@ -808,3 +808,76 @@ lines:</p> <a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsUIConstraints DuplexOff "*Duplex *OptionDuplexer False" <a href='ref-ppdcfile.html#Attribute'>Attribute</a> cupsUIResolver DuplexOff "*Duplex None" </pre> + +<h2 class='title'><a name='LOCALIZATION'>Localization</a></h2> + +<p>The PPD compiler provides localization of PPD files in different languages +through <i>message catalog</i> files in the GNU gettext or Apple .strings +formats. Each user text string and several key PPD attribute values such as +<tt>LanguageVersion</tt> and <tt>LanguageEncoding</tt> are looked up in the +corresponding message catalog and the translated text is substituted in the +generated PPD files. One message catalog file can be used by multiple driver +information files, and each file contains a single language translation.</p> + +<h3><a name='PPDPO'>The ppdpo Utility</a></h3> + +<p>While CUPS includes localizations of all standard media sizes and options in +several languages, your driver information files may provide their own media +sizes and options that need to be localized. CUPS provides a utility program to +aid in the localization of drivers called <a +href='man-ppdpo.html'><tt>ppdpo(1)</tt></a>. The <tt>ppdpo</tt> program creates +or updates a message catalog file based upon one or more driver information +files. New messages are added with the word "TRANSLATE" added to the front of +the translation string to make locating new strings for translation easier. The +program accepts the message catalog filename and one or more driver information +files.</p> + +<p>For example, run the following command to create a new German message catalog +called <var>de.po</var> for all of the driver information files in the current +directory:</p> + +<pre class='command'> +ppdpo -o de.po *.drv +</pre> + +<p>If the file <var>de.po</var> already exists, <tt>ppdpo</tt> will update the +contents of the file with any new messages that need to be translated. To create +an Apple .strings file instead, specify the output filename with a .strings +extension, for example:</p> + +<pre class='command'> +ppdpo -o de.strings *.drv +</pre> + +<h3><a name='PPDC_CATALOG'>Using Message Catalogs with the PPD Compiler</a></h3> + +<p>Once you have created a message catalog, use the <a +href='ref-ppdcfile.html#_po'><tt>#po</tt></a> directive to declare it in each +driver information file. For example, to declare the German message catalog for +a driver use:</p> + +<pre class='example'> +<a href='ref-ppdcfile.html#_po'>#po</a> de "de.po" // German +</pre> + +<p>In fact, you can use the <tt>#po</tt> directive as many times as needed:</p> + +<pre class='example'> +<a href='ref-ppdcfile.html#_po'>#po</a> de "de.po" // German +<a href='ref-ppdcfile.html#_po'>#po</a> es "es.po" // Spanish +<a href='ref-ppdcfile.html#_po'>#po</a> fr "fr.po" // French +<a href='ref-ppdcfile.html#_po'>#po</a> it "it.po" // Italian +<a href='ref-ppdcfile.html#_po'>#po</a> ja "ja.po" // Japanese +</pre> + +<p>The filename ("de.po", etc.) can be relative to the location of the driver +information file or an absolute path. Once defined, the PPD compiler will +automatically generate a globalized PPD for every language declared in your +driver information file. To generate a single-language PPD file, simply use the +<tt>-l</tt> option to list the corresponding locale, for example:</p> + +<pre class='command'> +ppdc -l de -d ppd/de mydrivers.drv +</pre> + +<p>to generate German PPD files.</p> |