Add RFC 2231 support. Thanks to Piotr Pawlow. (#2501379)
[squirrelmail.git] / doc / i18n.txt
index 5012d3c8d9056b07fdcaf414d7315c84e5b7a2db..2f5d60ef89d03816f80963598af7ff6cfa0e2b96 100644 (file)
@@ -92,8 +92,8 @@ Charset totals:
 -------------------
 2. $languages array
 -------------------
-$languages array is stored in functions/i18n.php and defines translations
-that are enabled in SquirrelMail.
+$languages array is stored in functions/i18n.php (v. 1.5.0 or older) or 
+locale/*/setup.php files and defines enabled SquirrelMail translations.
 
 Format of array:
     $languages['language_code']['key'] = 'value'
@@ -127,8 +127,8 @@ optional.
 XTRA_CODE functions provide way to change interface behavior, when translation
 requires special handling of some SquirrelMail functions. Functions are enabled
 by setting XTRA_CODE option in $languages array and including appropriate
-functions in functions/i18n.php. First part of function name is word listed in
-$languages['language_code']['XTRA_CODE'] value. Second part is one of special
+functions in locale/language_code/setup.php. First part of function name is word 
+listed in $languages['language_code']['XTRA_CODE'] value. Second part is one of special
 keywords. Possible keywords:
 * _decode
 Used in src/compose.php, src/i18n.php, src/view_text.php, functions/mime.php
@@ -200,25 +200,29 @@ 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 textdomain function. If SquirrelMail wrapper functions 
-are used, there is no need to issue sq_bindtextdomain when plugins reverts to
-SquirrelMail domain.
+From v.1.5.1 SquirrelMail includes support for plural forms. It allows the use
+of 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 of squirrels. The gettext
+functions also deal with non English languages that might use different word
+forms for two, five, ten or more units.
+
+Plural forms support is provided by ngettext functions that exist in the php
+gettext extension as of php 4.2.0 and by ngettext function replacements from
+the php-gettext classes (http://savannah.nongnu.org/projects/php-gettext).
+In order to provide identical functionality when the php gettext extension does
+not have ngettext support, SquirrelMail uses bindtextdomain and textdomain
+wrappers that load the missing functions.
+
+If plugin authors want to use ngettext functions without increasing php
+requirements to 4.2.0 with gettext support, they should require at least
+SquirrelMail 1.5.1, and use the sq_change_text_domain function instead of
+separate calls to bindtextdomain and textdomain. If sq_change_text_domain
+cannot be used, the sq_bindtextdomain function should be used instead of
+bindtextdomain and the sq_textdomain function should be used instead of the
+textdomain function. If these latter two SquirrelMail wrapper functions are
+used (but again, please use sq_change_text_domain), there is no need to issue
+a call to sq_bindtextdomain when a plugin reverts to the 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
@@ -252,17 +256,97 @@ setup automatically when include/validate.php is loaded.
 
 If TZ variable can't be modified (php is running is safe mode and variable 
 is not listed in php safe_mode_allowed_env_vars), user's time zone options are
-not visible and interface use default webserver's time zone.
-
-List of available time zones is stored in locale/timezones.cfg. Current list
-of time zones uses some time zone names that depend on webserver's system 
-libraries. These names are not compatible with Windows operating system.
-
-TODO: move time zone information to php array in order to be able to translate 
-it and make sure that time zone names are compatible with Windows operating
-system. Or at least provide 'default' and 'strict' time zone options in
-SquirrelMail configuration. Maybe even provide 'custom' time zone list
-options.
+not visible and interface uses default webserver's time zone.
+
+SquirrelMail 1.5.0 and older store list of available time zones in 
+locale/timezones.cfg. Since 1.5.1 standard times zones are moved to 
+include/timezones/standard.php and time zone handling differs from older
+SquirrelMail versions. Time zone configuration is controlled in SquirrelMail
+configuration utility (conf.pl), 4. General Options -> 15. Time zone
+configuration menu option. Administrator can select standard, strict, custom 
+and custom strict time zone handling.
+
+Standard handling does not differ from previous SquirrelMail versions and
+SquirrelMail uses GNU C geographical location based time zone names. Strict
+handling uses time zone codes with offset from GMT. Strict time zones should
+work on systems that don't support GNU C time zone naming. Custom and custom
+strict handling uses config/timezones.php file instead of
+include/timezones/standard.php.
+
+config/timezones.php file should store $aTimeZones array with different set of
+time zones. See default time zone set in include/timezones/standard.php.For
+example:
+
+<?php
+// World outside US border is a mirage
+
+$aTimeZones=array();
+$aTimeZones['America/New_York']['NAME']='US Eastern standard time';
+$aTimeZones['America/New_York']['TZ']='EST5EDT';
+
+$aTimeZones['America/Chicago']['NAME']='US Central standard time';
+$aTimeZones['America/Chicago']['TZ']='CST6CDT';
+
+// Oliver County, ND
+$aTimeZones['America/North_Dakota/Center']['NAME']='US, Oliver County [ND]';
+$aTimeZones['America/North_Dakota/Center']['TZ']='CST6CDT'; // CST since 1992
+
+$aTimeZones['America/Denver']['NAME']='US Mountain standard time';
+$aTimeZones['America/Denver']['TZ']='MST7MDT';
+
+$aTimeZones['America/Los_Angeles']['NAME']='US Pacific standard time';
+$aTimeZones['America/Los_Angeles']['TZ']='PST8PDT';
+
+// Aliaska
+$aTimeZones['America/Juneau']['NAME']='Aliaska, Juneau';
+$aTimeZones['America/Juneau']['TZ']='NAST9NADT';
+$aTimeZones['America/Yakutat']['NAME']='Aliaska, Yakutat';
+$aTimeZones['America/Yakutat']['TZ']='NAST9NADT';
+$aTimeZones['America/Anchorage']['NAME']='Aliaska, Anchorage';
+$aTimeZones['America/Anchorage']['TZ']='NAST9NADT';
+$aTimeZones['America/Nome']['NAME']='Aliaska, Nome';
+$aTimeZones['America/Nome']['TZ']='NAST9NADT';
+$aTimeZones['America/Adak']['NAME']='US, Aleutian Islands';
+$aTimeZones['America/Adak']['TZ']='AST10ADT';
+
+$aTimeZones['Pacific/Honolulu']['NAME']='US, Hawaii';
+$aTimeZones['Pacific/Honolulu']['TZ']='UCT10';
+$aTimeZones['America/Phoenix']['NAME']='US, Arizona';
+$aTimeZones['America/Phoenix']['TZ']='MST7'; // gmt-7
+$aTimeZones['America/Shiprock']['LINK']='America/Denver';
+
+$aTimeZones['America/Boise']['NAME']='US, South Idaho';
+$aTimeZones['America/Boise']['TZ']='MST7MDT';
+$aTimeZones['America/Indianapolis']['NAME']='US, Indiana';
+$aTimeZones['America/Indianapolis']['TZ']='EST5';
+$aTimeZones['America/Indiana/Indianapolis']['LINK']='America/Indianapolis';
+// Crawford County, Indiana
+$aTimeZones['America/Indiana/Marengo']['NAME']='US, Crawford County [IN]';
+$aTimeZones['America/Indiana/Marengo']['TZ']='EST5';
+// Starke County, Indiana
+$aTimeZones['America/Indiana/Knox']['NAME']='US, Starke County [IN]';
+$aTimeZones['America/Indiana/Knox']['TZ']='EST5';
+// Switzerland County, Indiana
+$aTimeZones['America/Indiana/Vevay']['NAME']='US, Switzerland County [IN]';
+$aTimeZones['America/Indiana/Vevay']['TZ']='EST5';
+$aTimeZones['America/Louisville']['NAME']='US, Louisville [KY]';
+$aTimeZones['America/Louisville']['TZ']='EST5EDT';
+$aTimeZones['America/Kentucky/Louisville']['LINK']='America/Louisville';
+// Wayne, Clinton, and Russell Counties, Kentucky
+$aTimeZones['America/Kentucky/Monticello']['NAME']='US, Wayne, Clinton, and Russell Counties [KY]';
+$aTimeZones['America/Kentucky/Monticello']['TZ']='EST5EDT';
+// Michigan
+$aTimeZones['America/Detroit']['NAME']='US, Michigan';
+$aTimeZones['America/Detroit']['TZ']='EST5EDT';
+// The Michigan border with Wisconsin switched from EST to CST/CDT in 1973.
+$aTimeZones['America/Menominee']['NAME']='US, Menominee [MI]';
+$aTimeZones['America/Menominee']['TZ']='CST6CDT';
+?>
+
+GNU C time zone naming should be supported by many Unix OSes. It is recommended
+way of setting time zone, because it handles historical changes and daylight
+savings specific to selected geographical location. Strict time zones might
+provide inaccurate or outdated time zone settings.
 
 If modifications in TZ environment are visible in your webserver's logs (time
 offset is changed), make sure that you can reproduce such behavior in latest php