X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=gettext-tools%2Fdoc%2Fgettext_11.html;h=a4a443a26b9167f8dc77a49cdf387aec42dad27d;hb=refs%2Fchanges%2F82%2F71082%2F1;hp=9cac0d0fb22eb5b3c23c81cebe2bd7ff16f05cb5;hpb=5d61132f836323aaf2879e04abc9d4056db248a2;p=platform%2Fupstream%2Fgettext.git diff --git a/gettext-tools/doc/gettext_11.html b/gettext-tools/doc/gettext_11.html index 9cac0d0..a4a443a 100644 --- a/gettext-tools/doc/gettext_11.html +++ b/gettext-tools/doc/gettext_11.html @@ -1,7 +1,7 @@ + from gettext.texi on 28 December 2015 --> GNU gettext utilities - 11 The Programmer's View @@ -11,7 +11,7 @@ Go to the first, previous


-

11 The Programmer's View

+

11 The Programmer's View

One aim of the current message catalog implementation provided by @@ -29,9 +29,9 @@ later explain our solution of this dilemma. -

11.1 About catgets

+

11.1 About catgets

- +

@@ -64,9 +64,9 @@ therefore part of all Unix implementation (implementations, which are -

11.1.1 The Interface

+

11.1.1 The Interface

- +

@@ -79,7 +79,7 @@ for the functions and the needed definitions are in the

- + catopen is used like in this:

@@ -98,7 +98,7 @@ message catalog, equivalent to handles to file returned by open.

- + This handle is of course used in the catgets function which can be used like this: @@ -130,7 +130,7 @@ should better be const char *, but the standard is published in

- + The last of these functions is used and behaves as expected:

@@ -145,9 +145,9 @@ After this no catgets call using the descriptor is legal anymore.

-

11.1.2 Problems with the catgets Interface?!

+

11.1.2 Problems with the catgets Interface?!

- +

@@ -166,9 +166,9 @@ more easy to manage.

-

11.2 About gettext

+

11.2 About gettext

- +

@@ -183,7 +183,7 @@ The main point about this solution is that it does not follow the method of normal file handling (open-use-close) and that it does not burden the programmer with so many tasks, especially the unique key handling. Of course here also a unique key is needed, but this key is the message -itself (how long or short it is). See section 11.3 Comparing the Two Interfaces for a more +itself (how long or short it is). See section 11.3 Comparing the Two Interfaces for a more detailed comparison of the two methods.

@@ -197,9 +197,9 @@ in using this library will be interested in this description. -

11.2.1 The Interface

+

11.2.1 The Interface

- +

@@ -268,11 +268,11 @@ your language.

-

11.2.2 Solving Ambiguities

+

11.2.2 Solving Ambiguities

- - - + + +

@@ -346,9 +346,9 @@ unreliabilities.

-

11.2.3 Locating Message Catalog Files

+

11.2.3 Locating Message Catalog Files

- +

@@ -387,10 +387,10 @@ through the third argument.

-

11.2.4 How to specify the output character set gettext uses

+

11.2.4 How to specify the output character set gettext uses

- - + +

@@ -422,7 +422,7 @@ recommended that all msgids be US-ASCII strings.

Function: char * bind_textdomain_codeset (const char *domainname, const char *codeset) -
+
The bind_textdomain_codeset function can be used to specify the output character set for message catalogs for domain domainname. The codeset argument must be a valid codeset name which can be used @@ -454,12 +454,12 @@ global variable errno is set accordingly.

-

11.2.5 Using contexts for solving ambiguities

+

11.2.5 Using contexts for solving ambiguities

- - - - + + + +

@@ -497,7 +497,7 @@ over the functions from <libintl.h>.

- +

 const char *pgettext (const char *msgctxt, const char *msgid);
@@ -532,8 +532,8 @@ fetches a particular translation of the msgid.
 
 

- - + +

 const char *dpgettext (const char *domain_name,
@@ -618,9 +618,9 @@ string literals, more general macros are available:
 
 

- - - + + +

 const char *pgettext_expr (const char *msgctxt, const char *msgid);
@@ -640,9 +640,9 @@ efficient.
 

-

11.2.6 Additional functions for plural forms

+

11.2.6 Additional functions for plural forms

- +

@@ -765,7 +765,7 @@ purpose.

Function: char * ngettext (const char *msgid1, const char *msgid2, unsigned long int n) -
+
The ngettext function is similar to the gettext function as it finds the message catalogs in the same way. But it takes two extra arguments. The msgid1 parameter must contain the singular @@ -836,7 +836,7 @@ printf (ngettext ("%$2d file removed from directory %$1s",

-See section 15.3.1 C Format Strings for details about this argument reordering syntax. +See section 15.3.1 C Format Strings for details about this argument reordering syntax.

@@ -875,7 +875,7 @@ In this case the number n is only used to choose the plural form.

Function: char * dngettext (const char *domain, const char *msgid1, const char *msgid2, unsigned long int n) -
+
The dngettext is similar to the dgettext function in the way the message catalog is selected. The difference is that it takes two extra parameter to provide the correct plural form. These two @@ -886,7 +886,7 @@ parameters are handled in the same way ngettext handles them.

Function: char * dcngettext (const char *domain, const char *msgid1, const char *msgid2, unsigned long int n, int category) -
+
The dcngettext is similar to the dcgettext function in the way the message catalog is selected. The difference is that it takes two extra parameter to provide the correct plural form. These two @@ -911,9 +911,9 @@ possibility of extensions to not prevent the use of new languages).

- - - + + + The information about the plural form selection has to be stored in the header entry of the PO file (the one with the empty msgid string). The plural form information looks like this: @@ -941,7 +941,7 @@ value of nplurals.

- + The following rules are known at this point. The language with families are listed. But this does not necessarily mean the information can be generalized for the whole family (as can be easily seen in the table @@ -970,6 +970,9 @@ Languages with this property include: Japanese, Vietnamese, Korean +

Tai-Kadai family +
+Thai
Two forms, singular used for one only @@ -1014,6 +1017,9 @@ Estonian
Semitic family
Hebrew +
Austronesian family +
+Bahasa Indonesian
Artificial
Esperanto @@ -1219,6 +1225,26 @@ Languages with this property include:
Slovenian
+ +
Six forms, special cases for one, two, all numbers ending in 02, 03, ... 10, all numbers ending in 11 ... 99, and others +
+The header entry would look like this: + + +
+Plural-Forms: nplurals=6; \
+    plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 \
+    : n%100>=11 ? 4 : 5;
+
+ +Languages with this property include: + +
+ +
Afroasiatic family +
+Arabic +

@@ -1279,14 +1305,14 @@ is acceptable in English, and similarly for other languages.

The translators' perspective regarding plural forms is explained in -section 12.6 Translating plural forms. +section 12.6 Translating plural forms.

-

11.2.7 Optimization of the *gettext functions

+

11.2.7 Optimization of the *gettext functions

- +

@@ -1339,10 +1365,10 @@ find the result through a single cache lookup.

-

11.3 Comparing the Two Interfaces

+

11.3 Comparing the Two Interfaces

- - + +

@@ -1392,7 +1418,7 @@ by

- +

 #include <libintl.h>
@@ -1407,7 +1433,7 @@ can use any that becomes available.
 
 

- + The same procedure can be done for the gettext_noop invocations (see section 4.7 Special Cases of Translatable Strings). One usually defines gettext_noop as a no-op macro. So you should consider the following code for your project: @@ -1486,12 +1512,12 @@ little bit. But it is not impossible to overcome.

catgets allows same original entry to have different translations, but gettext has another, scalable approach for solving ambiguities -of this kind: See section 11.2.2 Solving Ambiguities. +of this kind: See section 11.2.2 Solving Ambiguities.

-

11.4 Using libintl.a in own programs

+

11.4 Using libintl.a in own programs

Starting with version 0.9.4 the library libintl.h should be @@ -1502,7 +1528,7 @@ and the library in directories selected using the $(prefix).

-

11.5 Being a gettext grok

+

11.5 Being a gettext grok

NOTE: This documentation section is outdated and needs to be @@ -1520,7 +1546,7 @@ is a list comments:

- + The variable _nl_msg_cat_cntr is defined in ‘loadmsgcat.c’. You don't need to know what this is for. But it can be used to detect whether a gettext implementation is GNU gettext and not non-GNU @@ -1594,7 +1620,7 @@ system's native gettext implementation. -

11.6 Temporary Notes for the Programmers Chapter

+

11.6 Temporary Notes for the Programmers Chapter

NOTE: This documentation section is outdated and needs to be @@ -1604,7 +1630,7 @@ revised. -

11.6.1 Temporary - Two Possible Implementations

+

11.6.1 Temporary - Two Possible Implementations

There are two competing methods for language independent messages: @@ -1636,7 +1662,7 @@ see the Programming for Internationalization FAQ.

-

11.6.2 Temporary - About catgets

+

11.6.2 Temporary - About catgets

There have been a few discussions of late on the use of @@ -1681,7 +1707,7 @@ of all Unix systems.

-

11.6.3 Temporary - Why a single implementation

+

11.6.3 Temporary - Why a single implementation

Now it seems kind of wasteful to me to have two different systems @@ -1726,7 +1752,7 @@ the future.

-

11.6.4 Temporary - Notes

+

11.6.4 Temporary - Notes

X/Open agreed very late on the standard form so that many