From 4a82caba2fca91144db2bddb7ee2cfae7dbe9537 Mon Sep 17 00:00:00 2001 From: tokul Date: Wed, 24 Nov 2004 16:12:08 +0000 Subject: [PATCH] adding information about ngettext git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8395 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- doc/i18n.txt | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/doc/i18n.txt b/doc/i18n.txt index f3c36f0e..fff433bf 100644 --- a/doc/i18n.txt +++ b/doc/i18n.txt @@ -8,6 +8,7 @@ provide information about some aspects of implementation. 3. XTRA_CODE functions 4. Display of different charsets 5. IMAP folder names +6. Plural forms ------------------------------- 1. Supported languages @@ -180,5 +181,33 @@ intensive functions. IMAP folder names use UTF7-IMAP charset. Folder names that are stored in conf.pl must be encoded in UTF7-IMAP charset. SquirrelMail uses internal functions that convert folder names from/to utf7-imap charset. By default those -functions work with iso-8859-1 charset. Other iso-8859-x and utf-8 charsets are -supported only when php installation contains mbstring support. +functions work with iso-8859-1 charset. Other charsets are supported only +when php mbstring extension supports them. + +TODO: write independent implementation of charset to utf7-imap conversion. + +--------------- +6. Plural forms +--------------- +From v.1.5.1 SquirrelMail includes support of plural forms. It allows to use +correct translation forms with numbers. For example. "We have %s squirrel on +the roof." and "We have %s squirrels on the roof." can be written in one +function call without checking actual number for squirrels. Gettext functions +also deal with non English languages that might use different word forms for +two, five, ten or more units. + +Support is provided by ngettext functions that exist in php gettext extension +from php 4.2.0 and by ngettext function replacements from php-gettext classes +(http://savannah.nongnu.org/projects/php-gettext). In order to use it correctly +when php gettext extension does not have ngettext support, SquirrelMail uses +bindtextdomain and textdomain wrappers that load missing functions. + +If plugins want to use ngettext functions without increasing php requirements +to 4.2.0 with gettext support, they should require SquirrelMail 1.5.1, use +sq_bindtextdomain function instead of bindtextdomain and use sq_textdomain +function instead of text domain function. If SquirrelMail wrapper functions +are used, there is no need to issue sq_bindtextdomain when plugins reverts to +SquirrelMail domain. + +More information about ngettext and plural forms can be found at: +http://www.gnu.org/software/gettext/manual/html_chapter/gettext_10.html#SEC150 -- 2.25.1