Changeset 22085 for branches/version-2_12-multilang/data/class
- Timestamp:
- 2012/11/08 14:01:51 (14 years ago)
- Location:
- branches/version-2_12-multilang/data/class
- Files:
-
- 3 edited
-
SC_I18n.php (modified) (2 diffs)
-
SC_Initial.php (modified) (2 diffs)
-
helper/SC_Helper_Locale.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-multilang/data/class/SC_I18n.php
r22059 r22085 44 44 // If language code is not specified, use site default. 45 45 if (empty($options['lang_code'])) { 46 $options['lang_code'] = LANG_CODE; 46 if (defined(LANG_CODE)) { 47 $options['lang_code'] = LANG_CODE; 48 } else { 49 $options['lang_code'] = 'en'; 50 } 47 51 } 48 52 // If device type ID is not specified, detect the viewing device. … … 82 86 // If language code is not specified, use site default. 83 87 if (empty($options['lang_code'])) { 84 $options['lang_code'] = LANG_CODE; 88 if (defined(LANG_CODE)) { 89 $options['lang_code'] = LANG_CODE; 90 } else { 91 $options['lang_code'] = 'en'; 92 } 85 93 } 86 94 // If device type ID is not specified, detect the viewing device. -
branches/version-2_12-multilang/data/class/SC_Initial.php
r22059 r22085 190 190 191 191 $mtb_constants = file_get_contents(CACHE_REALDIR . '../mtb_constants_init.php'); 192 $errorMessage = SC_I18n_Ex::t('SC_Initial_001', array('T_CACHE_REALDIR' => CACHE_REALDIR), array(' lang_code' => 'ja', 'device_type_id' => FALSE));192 $errorMessage = SC_I18n_Ex::t('SC_Initial_001', array('T_CACHE_REALDIR' => CACHE_REALDIR), array('device_type_id' => FALSE)); 193 193 if (is_writable(CACHE_REALDIR)) { 194 194 $handle = fopen(CACHE_REALDIR . 'mtb_constants.php', 'w'); … … 206 206 } 207 207 } else { 208 die(SC_I18n_Ex::t('SC_Initial_002', array('T_CACHE_REALDIR' => CACHE_REALDIR), array(' lang_code' => 'ja', 'device_type_id' => FALSE)));208 die(SC_I18n_Ex::t('SC_Initial_002', array('T_CACHE_REALDIR' => CACHE_REALDIR), array('device_type_id' => FALSE))); 209 209 } 210 210 } -
branches/version-2_12-multilang/data/class/helper/SC_Helper_Locale.php
r22049 r22085 50 50 // Set language code when it is not set. 51 51 if ($lang_code === FALSE) { 52 $lang_code = LANG_CODE; 52 if (defined(LANG_CODE)) { 53 $lang_code = LANG_CODE; 54 } else { 55 $lang_code = 'en'; 56 } 53 57 } 54 58 // Get string list of specified language. 55 $translations = $this->get_translations($lang_code, $device_type_id); 56 // Whether a string which corresponding with alias is exist. 57 if (isset($translations[$string])) { 58 return $translations[$string]; 59 } 60 else { 59 if ($lang_code == 'en') { 61 60 return $string; 61 } else { 62 $translations = $this->get_translations($lang_code, $device_type_id); 63 // Whether a string which corresponding with alias is exist. 64 if (isset($translations[$string])) { 65 return $translations[$string]; 66 } 67 else { 68 return $string; 69 } 62 70 } 63 71 } … … 151 159 // Set language code when it is not set. 152 160 if ($lang_code === FALSE) { 153 $lang_code = LANG_CODE; 161 if (defined(LANG_CODE)) { 162 $lang_code = LANG_CODE; 163 } else { 164 $lang_code = 'en'; 165 } 154 166 } 155 167 // Get a formula
Note: See TracChangeset
for help on using the changeset viewer.
