Changeset 22226 for branches/version-2_12-multilang
- Timestamp:
- 2013/01/11 00:21:16 (11 years ago)
- Location:
- branches/version-2_12-multilang/data
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-multilang/data/Smarty/templates/admin/ownersstore/plugin.tpl
r22186 r22226 128 128 <h2><!--{t string="tpl_464"}--></h2> 129 129 <table class="form"> 130 <!--{* 案1 *}-->131 130 <tr> 132 <th><!--{t string="tpl_465"}--> <!--{t string="<require>"}--></th> 133 <td> 134 <!--{assign var=key value="plugin_file"}--> 135 <span class="attention"><!--{$arrErr[$key]}--></span> 136 <input type="file" name="<!--{ $key }-->" class="box45" size="43" style="<!--{$arrErr[$key]|sfGetErrorColor}--> <!--{if $arrErr[$key]}--> background-color:<!--{$smarty.const.ERR_COLOR|h}--><!--{/if}-->"> 137 <a class="btn-action" href="javascript:;" onclick="install(); return false;"><span class="btn-next"><!--{t string="tpl_466"}--></span></a> 138 </td> 139 </tr> 140 <!--{* 案2 *}--> 141 <tr> 142 <th><!--{t string="tpl_465"}--> <span class='attention'><!--{t string="require_mark"}--></span></th> 131 <th><!--{t string="tpl_465" escape="none"}--></th> 143 132 <td> 144 133 <!--{assign var=key value="plugin_file"}--> -
branches/version-2_12-multilang/data/class/helper/SC_Helper_Locale.php
r22186 r22226 39 39 * @var SC_Helper_Locale 40 40 */ 41 42 43 41 static $_instance = NULL; 42 43 public $_translations = array(); 44 44 45 45 /** … … 50 50 * @return string a string corresponding with message alias 51 51 */ 52 52 public static function get_locale($string, &$options) { 53 53 is_null(SC_Helper_Locale_Ex::$_instance) and SC_Helper_Locale_Ex::$_instance = new SC_Helper_Locale_Ex(); 54 54 … … 71 71 72 72 $return = $string; 73 73 74 // Get string list of specified language. 74 75 if ($lang_code != 'en') { … … 80 81 } 81 82 82 $esc_types = $options['escape']; 83 if (is_null($esc_types) && $string[0] !== '<') { 84 $esc_types = 'h'; 85 } 86 foreach (explode(',', $esc_types) as $esc_type) { 87 switch ($esc_type) { 88 case 'h': 89 case 'html': 90 $return = htmlspecialchars($return, ENT_QUOTES); 91 break; 92 93 case 'j': 94 case 'javascript': 95 // escape quotes and backslashes, newlines, etc. 96 $return = strtr($return, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/')); 97 break; 98 99 case 'nl2br': 100 $return = nl2br($return, true); 101 break; 102 103 case '': 104 case 'none': 105 break; 106 107 case 'htmlall': 108 $return = htmlentities($return, ENT_QUOTES); 109 break; 110 111 case 'u': 112 case 'url': 113 $return = rawurlencode($return); 114 break; 115 116 case 'urlpathinfo': 117 $return = str_replace('%2F','/',rawurlencode($return)); 118 break; 119 120 case 'quotes': 121 // escape unescaped single quotes 122 $return = preg_replace("%(?<!\\\\)'%", "\\'", $return); 123 break; 124 125 case 'hex': 126 // escape every character into hex 127 $text = ''; 128 for ($x=0; $x < strlen($return); $x++) { 129 $text .= '%' . bin2hex($return[$x]); 130 } 131 $return = $text; 132 break; 133 134 case 'hexentity': 135 $text = ''; 136 for ($x=0; $x < strlen($return); $x++) { 137 $text .= '&#x' . bin2hex($return[$x]) . ';'; 138 } 139 $return = $text; 140 break; 141 142 case 'decentity': 143 $text = ''; 144 for ($x=0; $x < strlen($return); $x++) { 145 $text .= '&#' . ord($return[$x]) . ';'; 146 } 147 $return = $text; 148 break; 149 150 case 'mail': 151 // safe way to display e-mail address on a web page 152 $return = str_replace(array('@', '.'),array(' [AT] ', ' [DOT] '), $return); 153 break; 154 155 case 'nonstd': 156 // escape non-standard chars, such as ms document quotes 157 $_res = ''; 158 for($_i = 0, $_len = strlen($return); $_i < $_len; $_i++) { 159 $_ord = ord(substr($return, $_i, 1)); 160 // non-standard char, escape it 161 if($_ord >= 126){ 162 $_res .= '&#' . $_ord . ';'; 163 } 164 else { 165 $_res .= substr($return, $_i, 1); 166 } 167 } 168 $return = $_res; 169 break; 170 171 default: 172 trigger_error('unknown escape type. ' . var_export(func_get_args(), true), E_USER_WARNING); 173 break; 83 if (is_array($options['escape'])) { 84 foreach ($options['escape'] as $esc_type) { 85 $return = SC_Helper_Locale_Ex::escape($return, $esc_type); 174 86 } 175 87 } … … 272 184 return $file_list; 273 185 } 186 187 /** 188 * 文字列のエスケープを行う 189 * 190 * @param string $string エスケープを行う文字列 191 * @param string $esc_type エスケープの種類 192 * @return string エスケープを行った文字列 193 */ 194 static function escape($string, $esc_type) { 195 $return = $string; 196 197 switch ($esc_type) { 198 case 'h': 199 case 'html': 200 $return = htmlspecialchars($return, ENT_QUOTES); 201 break; 202 203 case 'j': 204 case 'javascript': 205 // escape quotes and backslashes, newlines, etc. 206 $return = strtr($return, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/')); 207 break; 208 209 case 'nl2br': 210 $return = nl2br($return, true); 211 break; 212 213 case '': 214 case 'none': 215 break; 216 217 case 'htmlall': 218 $return = htmlentities($return, ENT_QUOTES); 219 break; 220 221 case 'u': 222 case 'url': 223 $return = rawurlencode($return); 224 break; 225 226 case 'urlpathinfo': 227 $return = str_replace('%2F','/',rawurlencode($return)); 228 break; 229 230 case 'quotes': 231 // escape unescaped single quotes 232 $return = preg_replace("%(?<!\\\\)'%", "\\'", $return); 233 break; 234 235 case 'hex': 236 // escape every character into hex 237 $text = ''; 238 for ($x=0; $x < strlen($return); $x++) { 239 $text .= '%' . bin2hex($return[$x]); 240 } 241 $return = $text; 242 break; 243 244 case 'hexentity': 245 $text = ''; 246 for ($x=0; $x < strlen($return); $x++) { 247 $text .= '&#x' . bin2hex($return[$x]) . ';'; 248 } 249 $return = $text; 250 break; 251 252 case 'decentity': 253 $text = ''; 254 for ($x=0; $x < strlen($return); $x++) { 255 $text .= '&#' . ord($return[$x]) . ';'; 256 } 257 $return = $text; 258 break; 259 260 case 'mail': 261 // safe way to display e-mail address on a web page 262 $return = str_replace(array('@', '.'),array(' [AT] ', ' [DOT] '), $return); 263 break; 264 265 case 'nonstd': 266 // escape non-standard chars, such as ms document quotes 267 $_res = ''; 268 for($_i = 0, $_len = strlen($return); $_i < $_len; $_i++) { 269 $_ord = ord(substr($return, $_i, 1)); 270 // non-standard char, escape it 271 if($_ord >= 126){ 272 $_res .= '&#' . $_ord . ';'; 273 } 274 else { 275 $_res .= substr($return, $_i, 1); 276 } 277 } 278 $return = $_res; 279 break; 280 281 default: 282 trigger_error('unknown escape type. ' . var_export(func_get_args(), true), E_USER_WARNING); 283 break; 284 } 285 286 return $return; 287 } 274 288 } -
branches/version-2_12-multilang/data/locales/ja.po
r22209 r22226 3 3 "Project-Id-Version: EC-CUBE Core\n" 4 4 "POT-Creation-Date: 2012-05-07 13T_39+0900\n" 5 "PO-Revision-Date: 2013-01- 08 15:42+0900\n"5 "PO-Revision-Date: 2013-01-11 00:11+0900\n" 6 6 "Last-Translator: MATSUDA Terutaka <matsudaterutaka@gmail.com>\n" 7 7 "Language-Team: \n" … … 5032 5032 5033 5033 msgid "tpl_465" 5034 msgstr "プラグイン "5034 msgstr "プラグイン<span class='attention'> *</span>" 5035 5035 5036 5036 msgid "tpl_466" … … 6132 6132 msgid "pt_suffix" 6133 6133 msgstr "pt" 6134 6135 msgid "<require>"6136 msgstr "<span class='attention'>*</span>"6137 6138 msgid "require_mark"6139 msgstr "*" -
branches/version-2_12-multilang/data/smarty_extends/function.t.php
r22186 r22226 46 46 } 47 47 // エスケープの指定がある場合、オプションに移す 48 if (isset($params['escape'])) { 49 $options['escape'] = $params['escape']; 50 unset($params['escape']); 48 if (strlen($params['escape']) >= 1) { 49 $options['escape'] = explode(',', $params['escape']); 50 } else { 51 $options['escape'] = array('h', 'nl2br'); 51 52 } 53 unset($params['escape']); 52 54 53 55 return t($string, $params, $options);
Note: See TracChangeset
for help on using the changeset viewer.