Changeset 71ced07 in github
- Timestamp:
- May 9, 2012 7:09:36 AM (13 months ago)
- Branches:
- release-0.8
- Children:
- 951c9b3a
- Parents:
- f5d2f08
- git-author:
- Aleksander Machniak <alec@…> (05/09/12 06:47:44)
- git-committer:
- Aleksander Machniak <alec@…> (05/09/12 07:09:36)
- Files:
-
- 3 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcmail.php (modified) (1 diff)
-
program/include/rcube_plugin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
raca50c1 r71ced07 2 2 =========================== 3 3 4 - Use similar language as a fallback for plugin localization (#1488401) 4 5 - Fix issue where signature wasn't re-added on draft compose (#1488322) 5 6 - Update to TinyMCE 3.5 (#1488459) -
program/include/rcmail.php
ra9c1b87 r71ced07 1168 1168 1169 1169 // include user language files 1170 if ($lang != 'en' && is_dir(INSTALL_PATH . 'program/localization/' . $lang)) {1170 if ($lang != 'en' && $lang != 'en_US' && is_dir(INSTALL_PATH . 'program/localization/' . $lang)) { 1171 1171 include_once(INSTALL_PATH . 'program/localization/' . $lang . '/labels.inc'); 1172 1172 include_once(INSTALL_PATH . 'program/localization/' . $lang . '/messages.inc'); -
program/include/rcube_plugin.php
r479af905 r71ced07 153 153 { 154 154 $domain = $this->ID; 155 156 $lang = $_SESSION['language'];155 $lang = $_SESSION['language']; 156 $langs = array_unique(array('en_US', $lang)); 157 157 $locdir = slashify(realpath(slashify($this->home) . $dir)); 158 $texts = array(); 158 $texts = array(); 159 160 // Language aliases used to find localization in similar lang, see below 161 $aliases = array( 162 'de_CH' => 'de_DE', 163 'es_AR' => 'es_ES', 164 'fa_AF' => 'fa_IR', 165 'nl_BE' => 'nl_NL', 166 'pt_BR' => 'pt_PT', 167 'zh_CN' => 'zh_TW', 168 ); 159 169 160 170 // use buffering to handle empty lines/spaces after closing PHP tag 161 171 ob_start(); 162 172 163 foreach ( array('en_US', $lang)as $lng) {173 foreach ($langs as $lng) { 164 174 $fpath = $locdir . $lng . '.inc'; 165 175 if (is_file($fpath) && is_readable($fpath)) { 166 include ($fpath);176 include $fpath; 167 177 $texts = (array)$labels + (array)$messages + (array)$texts; 178 } 179 else if ($lng != 'en_US') { 180 // Find localization in similar language (#1488401) 181 $alias = null; 182 if (!empty($aliases[$lng])) { 183 $alias = $aliases[$lng]; 184 } 185 else if ($key = array_search($lng, $aliases)) { 186 $alias = $key; 187 } 188 189 if (!empty($alias)) { 190 $fpath = $locdir . $alias . '.inc'; 191 if (is_file($fpath) && is_readable($fpath)) { 192 include $fpath; 193 $texts = (array)$labels + (array)$messages + (array)$texts; 194 } 195 } 168 196 } 169 197 }
Note: See TracChangeset
for help on using the changeset viewer.
