Changeset 59041fd in github
- Timestamp:
- May 9, 2012 6:47:44 AM (13 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo
- Children:
- 49ab20c
- Parents:
- 4d7e277
- Files:
-
- 3 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube.php (modified) (1 diff)
-
program/include/rcube_plugin.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r837de85 r59041fd 2 2 =========================== 3 3 4 4 - Use similar language as a fallback for plugin localization (#1488401) 5 5 - Fix issue where signature wasn't re-added on draft compose (#1488322) 6 6 - Update to TinyMCE 3.5 (#1488459) -
program/include/rcube.php
r58154f5 r59041fd 632 632 633 633 // include user language files 634 if ($lang != 'en' && is_dir(INSTALL_PATH . 'program/localization/' . $lang)) {634 if ($lang != 'en' && $lang != 'en_US' && is_dir(INSTALL_PATH . 'program/localization/' . $lang)) { 635 635 include_once(INSTALL_PATH . 'program/localization/' . $lang . '/labels.inc'); 636 636 include_once(INSTALL_PATH . 'program/localization/' . $lang . '/messages.inc'); -
program/include/rcube_plugin.php
rbe98dfc2 r59041fd 154 154 { 155 155 $domain = $this->ID; 156 157 $lang = $_SESSION['language'];156 $lang = $_SESSION['language']; 157 $langs = array_unique(array('en_US', $lang)); 158 158 $locdir = slashify(realpath(slashify($this->home) . $dir)); 159 $texts = array(); 159 $texts = array(); 160 161 // Language aliases used to find localization in similar lang, see below 162 $aliases = array( 163 'de_CH' => 'de_DE', 164 'es_AR' => 'es_ES', 165 'fa_AF' => 'fa_IR', 166 'nl_BE' => 'nl_NL', 167 'pt_BR' => 'pt_PT', 168 'zh_CN' => 'zh_TW', 169 ); 160 170 161 171 // use buffering to handle empty lines/spaces after closing PHP tag 162 172 ob_start(); 163 173 164 foreach ( array('en_US', $lang)as $lng) {174 foreach ($langs as $lng) { 165 175 $fpath = $locdir . $lng . '.inc'; 166 176 if (is_file($fpath) && is_readable($fpath)) { 167 include ($fpath);177 include $fpath; 168 178 $texts = (array)$labels + (array)$messages + (array)$texts; 179 } 180 else if ($lng != 'en_US') { 181 // Find localization in similar language (#1488401) 182 $alias = null; 183 if (!empty($aliases[$lng])) { 184 $alias = $aliases[$lng]; 185 } 186 else if ($key = array_search($lng, $aliases)) { 187 $alias = $key; 188 } 189 190 if (!empty($alias)) { 191 $fpath = $locdir . $alias . '.inc'; 192 if (is_file($fpath) && is_readable($fpath)) { 193 include $fpath; 194 $texts = (array)$labels + (array)$messages + (array)$texts; 195 } 196 } 169 197 } 170 198 }
Note: See TracChangeset
for help on using the changeset viewer.
