Changeset 22085


Ignore:
Timestamp:
2012/11/08 14:01:51 (11 years ago)
Author:
pineray
Message:

#163 テキスト出力多言語対応

文字列のキーが英文となったことをうけた変更.

Location:
branches/version-2_12-multilang/data
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-multilang/data/class/SC_I18n.php

    r22059 r22085  
    4444        // If language code is not specified, use site default. 
    4545        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            } 
    4751        } 
    4852        // If device type ID is not specified, detect the viewing device. 
     
    8286        // If language code is not specified, use site default. 
    8387        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            } 
    8593        } 
    8694        // If device type ID is not specified, detect the viewing device. 
  • branches/version-2_12-multilang/data/class/SC_Initial.php

    r22059 r22085  
    190190 
    191191            $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)); 
    193193            if (is_writable(CACHE_REALDIR)) { 
    194194                $handle = fopen(CACHE_REALDIR . 'mtb_constants.php', 'w'); 
     
    206206            } 
    207207        } 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))); 
    209209        } 
    210210    } 
  • branches/version-2_12-multilang/data/class/helper/SC_Helper_Locale.php

    r22049 r22085  
    5050        // Set language code when it is not set. 
    5151        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            } 
    5357        } 
    5458        // 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') { 
    6160            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            } 
    6270        } 
    6371    } 
     
    151159        // Set language code when it is not set. 
    152160        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            } 
    154166        } 
    155167        // Get a formula 
  • branches/version-2_12-multilang/data/include/plural_forms.inc

    r22005 r22085  
    55 
    66return array( 
    7     'ja' => "nplurals=2; plural=(n!=1);" 
     7    'en' => "nplurals=2; plural=(n!=1);", 
     8    'ja' => "nplurals=2; plural=(n!=1);", 
    89); 
Note: See TracChangeset for help on using the changeset viewer.