Changeset 22045
- Timestamp:
- 2012/10/01 08:54:42 (12 years ago)
- Location:
- branches/version-2_12-multilang/data/class
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-multilang/data/class/SC_I18n.php
r22005 r22045 47 47 } 48 48 // If device type ID is not specified, detect the viewing device. 49 if ( empty($options['device_type_id'])) {49 if (!isset($options['device_type_id']) || ($options['device_type_id'] !== FALSE && !strlen($options['device_type_id']))) { 50 50 $options['device_type_id'] = SC_Display_Ex::detectDevice(); 51 51 } … … 85 85 } 86 86 // If device type ID is not specified, detect the viewing device. 87 if ( empty($options['device_type_id'])) {87 if (!isset($options['device_type_id']) || ($options['device_type_id'] !== FALSE && !strlen($options['device_type_id']))) { 88 88 $options['device_type_id'] = SC_Display_Ex::detectDevice(); 89 89 } -
branches/version-2_12-multilang/data/class/SC_Initial.php
r22041 r22045 207 207 } 208 208 } else { 209 die(SC_I18n_Ex::t('SC_INITIAL_ERROR_NOT_FOUND', array('T_CACHE_REALDIR' => CACHE_REALDIR), array('lang_code' => 'ja', 'device_type_id' => 10)));209 die(SC_I18n_Ex::t('SC_INITIAL_ERROR_NOT_FOUND', array('T_CACHE_REALDIR' => CACHE_REALDIR), array('lang_code' => 'ja', 'device_type_id' => FALSE))); 210 210 } 211 211 } -
branches/version-2_12-multilang/data/class/helper/SC_Helper_Locale.php
r22005 r22045 47 47 * @return string a string corresponding with message alias 48 48 */ 49 function get_locale($string, $lang_code = LANG_CODE, $device_type_id = DEVICE_TYPE_PC) {49 function get_locale($string, $lang_code = LANG_CODE, $device_type_id = FALSE) { 50 50 // Get string list of specified language. 51 51 $translations = $this->get_translations($lang_code, $device_type_id); … … 66 66 * @return array strings 67 67 */ 68 function get_translations($lang_code = LANG_CODE, $device_type_id = DEVICE_TYPE_PC) { 68 function get_translations($lang_code = LANG_CODE, $device_type_id = FALSE) { 69 $translations_key = "translations_" . $lang_code . "_" . $device_type_id; 69 70 // If the strings of specified language is not loaded 70 if (empty($this->_translations[$ lang_code][$device_type_id])) {71 if (empty($this->_translations[$translations_key])) { 71 72 $translations = array(); 72 73 … … 83 84 } 84 85 85 $this->_translations[$ lang_code][$device_type_id] = $translations;86 $this->_translations[$translations_key] = $translations; 86 87 } 87 88 88 return $this->_translations[$ lang_code][$device_type_id];89 return $this->_translations[$translations_key]; 89 90 } 90 91 … … 96 97 * @return array file list 97 98 */ 98 function get_locale_file_list($lang_code = LANG_CODE, $device_type_id = DEVICE_TYPE_PC) {99 function get_locale_file_list($lang_code = LANG_CODE, $device_type_id = FALSE) { 99 100 $file_list = array(); 100 101 … … 123 124 124 125 // Path to the template locale file. 125 $template_locale_path = HTML_REALDIR . SC_Helper_PageLayout_Ex::getUserDir($device_type_id, true) . "locales/{$lang_code}.mo"; 126 // If a locale file of specified language is exist, add to the file list. 127 if (file_exists($template_locale_path)) { 128 $file_list[] = $template_locale_path; 126 if ($device_type_id !== FALSE) { 127 $template_locale_path = HTML_REALDIR . SC_Helper_PageLayout_Ex::getUserDir($device_type_id, true) . "locales/{$lang_code}.mo"; 128 // If a locale file of specified language is exist, add to the file list. 129 if (file_exists($template_locale_path)) { 130 $file_list[] = $template_locale_path; 131 } 129 132 } 130 133
Note: See TracChangeset
for help on using the changeset viewer.