| 1 | SquirrelMail internationalization |
| 2 | |
| 3 | This document should explain how SquirrelMail internationalization works and |
| 4 | provide information about some aspects of implementation. |
| 5 | |
| 6 | 1. Supported languages |
| 7 | 2. $languages array |
| 8 | 3. XTRA_CODE functions |
| 9 | 4. Display of different charsets |
| 10 | 5. IMAP folder names |
| 11 | |
| 12 | ------------------------------- |
| 13 | 1. Supported languages |
| 14 | ------------------------------- |
| 15 | Valid language codes are: |
| 16 | * ar - Arabic, windows-1256 charset |
| 17 | * bg_BG - Bulgarian, windows-1251 charset |
| 18 | * bn_IN - Bengali, utf-8 charset |
| 19 | * ca_ES - Catalan, iso-8859-1 charset |
| 20 | * cs_CZ - Czech, iso-8859-2 charset |
| 21 | * cy_GB - Welsh, iso-8859-1 charset |
| 22 | * da_DK - Danish, iso-8859-1 charset |
| 23 | * de_DE - German, iso-8859-1 charset |
| 24 | * el_GR - Greek, iso-8859-7 charset |
| 25 | * en_GB - British, iso-8859-15 charset |
| 26 | * en_US - English, charset depends on $default_charset |
| 27 | * es_ES - Spanish, iso-8859-1 charset |
| 28 | * et_EE - Estonian, iso-8859-15 charset |
| 29 | * eu_ES - Basque, iso-8859-1 charset |
| 30 | * fa_IR - Farsi, utf-8 charset |
| 31 | * fi_FI - Finnish, iso-8859-1 charset |
| 32 | * fo_FO - Faroese, iso-8859-1 charset |
| 33 | * fr_FR - French, iso-8859-1 charset |
| 34 | * he_IL - Hebrew, windows-1255 charset |
| 35 | * hr_HR - Croatian, iso-8859-2 charset |
| 36 | * hu_HU - Hungarian, iso-8859-2 charset |
| 37 | * id_ID - Indonesian, iso-8859-1 charset |
| 38 | * is_IS - Icelandic, iso-8859-1 charset |
| 39 | * it_IT - Italian, iso-8859-1 charset |
| 40 | * ja_JP - Japanese, euc-jp charset (emails are created in iso-2022-jp) |
| 41 | * ko_KR - Korean, euc-kr charset |
| 42 | * lt_LT - Lithuanian, utf-8 charset |
| 43 | * ms_MY - Malay, iso-8859-1 charset |
| 44 | * nb_NO - Norwegian (Bokmal), iso-8859-1 charset |
| 45 | * nl_NL - Dutch, iso-8859-1 charset |
| 46 | * nn_NO - Norwegian (Nynorsk), iso-8859-1 charset |
| 47 | * pl_PL - Polish, iso-8859-2 charset |
| 48 | * pt_BR - Portuguese (Brazil), iso-8859-1 charset |
| 49 | * pt_PT - Portuguese (Portugal), iso-8859-1 charset |
| 50 | * ro_RO - Romanian, iso-8859-2 charset |
| 51 | * ru_UA - Ukrainian Russian, koi8-r charset |
| 52 | * ru_RU - Russian, utf-8 charset |
| 53 | * sk_SK - Slovak, iso-8859-2 charset |
| 54 | * sl_SI - Slovenian, iso-8859-2 charset |
| 55 | * sr_YU - Serbian, iso-8859-2 charset |
| 56 | * sv_SE - Swedish, iso-8859-1 charset |
| 57 | * ug - Uighur, utf-8 charset (some systems don't support Uighur system locale) |
| 58 | * th_TH - Thai, tis-620 charset |
| 59 | * tl_PH - Tagalog, iso-8859-1 charset (main translation is missing, only some plugins are translated) |
| 60 | * tr_TR - Turkish, iso-8859-9 charset |
| 61 | * uk_UA - Ukrainian, koi8-u charset |
| 62 | * zh_CN - Chinese Simplified, gb2312 charset |
| 63 | * zh_TW - Chinese Traditional, big5 charset |
| 64 | |
| 65 | Charset totals: |
| 66 | * iso-8859-1 = 21 |
| 67 | * iso-8859-2 = 8 |
| 68 | * utf-8 = 5 |
| 69 | * iso-8859-15 = 2 |
| 70 | * iso-8859-7 = 1 |
| 71 | * iso-8859-9 = 1 |
| 72 | * koi8-r = 1 |
| 73 | * koi8-u = 1 |
| 74 | * windows-1251 = 1 |
| 75 | * windows-1255 = 1 |
| 76 | * windows-1256 = 1 |
| 77 | * tis-620 = 1 |
| 78 | * gb2312 = 1 |
| 79 | * big5 = 1 |
| 80 | * euc-jp = 1 |
| 81 | * euc-kr = 1 |
| 82 | |
| 83 | ------------------- |
| 84 | 2. $languages array |
| 85 | ------------------- |
| 86 | $languages array is stored in functions/i18n.php and defines translations |
| 87 | that are enabled in SquirrelMail. |
| 88 | |
| 89 | Format of array: |
| 90 | $languages['language_code']['key'] = 'value' |
| 91 | |
| 92 | Possible array key names: |
| 93 | * NAME - Translation name in English. Any 8bit symbols must be html encoded. |
| 94 | * CHARSET - Charset used by translation |
| 95 | * ALIAS - 'language_code' should contain short language name |
| 96 | (iso-639). 'value' should contain name of other 'language_code' |
| 97 | that defines translation with NAME and CHARSET keys. |
| 98 | Entry links short language form with long form (language+country). |
| 99 | See: http://www.loc.gov/standards/iso639-2/langhome.html and |
| 100 | http://www.iso.org/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html |
| 101 | * ALTNAME - Native translation name. Any 8bit symbols must be html encoded. |
| 102 | Name is visible when $show_alternative_names is enabled. |
| 103 | * LOCALE - Full locale name (in xx_XX.charset format or other format required |
| 104 | by php gettext functions). From 1.4.4/1.5.1 'value' can contain |
| 105 | array. If php version is older than 4.3.0, system uses only first |
| 106 | locale name listed in array. First locale name must be compatible |
| 107 | with FreeBSD system locale names. |
| 108 | * DIR - Text direction. Used to define Right-to-Left languages. Possible |
| 109 | values 'rtl' or 'ltr'. If undefined - defaults to 'ltr'. |
| 110 | * XTRA_CODE - translation uses special functions. (see chapter 3. XTRA_CODE functions) |
| 111 | |
| 112 | Each 'language_code' definition requires NAME+CHARSET or ALIAS keys. Other keys are |
| 113 | optional. |
| 114 | |
| 115 | ---------------------- |
| 116 | 3. XTRA_CODE functions |
| 117 | ---------------------- |
| 118 | XTRA_CODE functions provide way to change interface behavior, when translation |
| 119 | requires special handling of some SquirrelMail functions. Functions are enabled |
| 120 | by setting XTRA_CODE option in $languages array and including appropriate |
| 121 | functions in functions/i18n.php. First part of function name is word listed in |
| 122 | $languages['language_code']['XTRA_CODE'] value. Second part is one of special |
| 123 | keywords. Possible keywords: |
| 124 | * _decode |
| 125 | Used in src/compose.php, src/i18n.php, src/view_text.php, functions/mime.php |
| 126 | Requires mbstring support |
| 127 | |
| 128 | * _encode |
| 129 | Used in src/compose.php, src/read_body.php |
| 130 | |
| 131 | * _encodeheader |
| 132 | Used in functions/mime.php |
| 133 | Returning function |
| 134 | |
| 135 | * _decodeheader |
| 136 | Used in functions/mime.php |
| 137 | Returning function |
| 138 | |
| 139 | * _downloadfilename |
| 140 | Used in functions/mime.php |
| 141 | |
| 142 | * _utf7_imap_encode |
| 143 | Used in functions/imap_utf7_local.php |
| 144 | Returning function |
| 145 | |
| 146 | * _utf7_imap_decode |
| 147 | Used in functions/imap_utf7_local.php |
| 148 | Returning function |
| 149 | |
| 150 | * _strimwidth |
| 151 | Used in functions/mailbox_display.php |
| 152 | Returning function |
| 153 | |
| 154 | * _wordwrap |
| 155 | Used in functions/strings.php (sqWordWrap) |
| 156 | |
| 157 | -------------------------------- |
| 158 | 4. Display of different charsets |
| 159 | -------------------------------- |
| 160 | When SquirrelMail generates html pages, it uses charset set by translation |
| 161 | selected by end user. Interface can display emails encoded in different |
| 162 | charsets. In order to display characters that might be unsupported by user's |
| 163 | charset, SquirrelMail uses decoding functions that convert non us-ascii symbols |
| 164 | into html entities. All decoding functions are stored in functions/decode/ |
| 165 | directory. |
| 166 | |
| 167 | By default SquirrelMail includes decoding functions that support iso-8859-x, |
| 168 | windows-125x, utf-8, us-ascii, koi8-r, koi8-u, tis-620, ns-4551_1, iso-ir-111, |
| 169 | cp855 and cp866 charsets. Other decoding functions are distributed in separate |
| 170 | packages. Separate packaging of decoding functions is supported from |
| 171 | SquirrelMail 1.4.4 and 1.5.0. |
| 172 | |
| 173 | Some decoding functions might require php recode support. If your php |
| 174 | installation does not support recode, you might be using slower and cpu/memory |
| 175 | intensive functions. |
| 176 | |
| 177 | -------------------- |
| 178 | 5. IMAP folder names |
| 179 | -------------------- |
| 180 | IMAP folder names use UTF7-IMAP charset. Folder names that are stored in |
| 181 | conf.pl must be encoded in UTF7-IMAP charset. SquirrelMail uses internal |
| 182 | functions that convert folder names from/to utf7-imap charset. By default those |
| 183 | functions work with iso-8859-1 charset. Other iso-8859-x and utf-8 charsets are |
| 184 | supported only when php installation contains mbstring support. |