From 97c9a8d72271152cf71373b9c7fbdc6036b92e89 Mon Sep 17 00:00:00 2001 From: msweet Date: Wed, 10 Jun 2009 19:02:58 +0000 Subject: 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 --- filter/Makefile | 5 ++-- filter/imagetoraster.c | 6 ++-- filter/ppd-compiler.shtml | 73 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+), 6 deletions(-) (limited to 'filter') 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:

Attribute cupsUIConstraints DuplexOff "*Duplex *OptionDuplexer False" Attribute cupsUIResolver DuplexOff "*Duplex None" + +

Localization

+ +

The PPD compiler provides localization of PPD files in different languages +through message catalog files in the GNU gettext or Apple .strings +formats. Each user text string and several key PPD attribute values such as +LanguageVersion and LanguageEncoding 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.

+ +

The ppdpo Utility

+ +

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 ppdpo(1). The ppdpo 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.

+ +

For example, run the following command to create a new German message catalog +called de.po for all of the driver information files in the current +directory:

+ +
+ppdpo -o de.po *.drv
+
+ +

If the file de.po already exists, ppdpo 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:

+ +
+ppdpo -o de.strings *.drv
+
+ +

Using Message Catalogs with the PPD Compiler

+ +

Once you have created a message catalog, use the #po directive to declare it in each +driver information file. For example, to declare the German message catalog for +a driver use:

+ +
+#po de "de.po"  // German
+
+ +

In fact, you can use the #po directive as many times as needed:

+ +
+#po de "de.po"  // German
+#po es "es.po"  // Spanish
+#po fr "fr.po"  // French
+#po it "it.po"  // Italian
+#po ja "ja.po"  // Japanese
+
+ +

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 +-l option to list the corresponding locale, for example:

+ +
+ppdc -l de -d ppd/de mydrivers.drv
+
+ +

to generate German PPD files.

-- cgit v1.2.3