[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

address@hidden: GNU Coding Standards, internatialisation and plurals]

From: Karl Berry
Subject: address@hidden: GNU Coding Standards, internatialisation and plurals]
Date: Fri, 19 May 2006 18:11:33 -0500

Seeking advice ... my response follows.

Date: Sun, 14 May 2006 15:47:08 +0200
From: "Michael Thayer" <address@hidden>
To: address@hidden
Subject: GNU Coding Standards, internatialisation and plurals


I would like to point out a problem with your advise on writing
strings in programmes for internationalisation.  To enable translators
to deal with plurals correctly, you recommend using the following


     printf ((nfiles != 1 ? "%d files processed"
              : "%d file processed"),


This has the problem that not all languages treat singular and plural
the same way as English.  For example, Arabic uses singular, dual and
plural rather than just singular and plural.  Russian uses a different
case depending on whether the number ends in 1, in 2-4 or in 5-9, 0 or
11-19.  And I believe many languages treat zero as singular (although
it is probably better to have a sentence like "No files processed" for
zero).  Newer versions of Gettext take these things into account.

Another thing worth mentioning is that it is better to limit strings
to be translated to one number argument per sentence unit (i.e.
"Searched %d directories.  Found %d files"  or "Searched %d
directories and found %d files" rather than "Found %d files in %d
directories") as some languages may prefer to express the arguments in
reverse order ("In %d directories found %d files"), which printf would
probably not take kindly to.

Kind regards,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]