Changeset 1021

Show
Ignore:
Timestamp:
01/11/07 07:24:40 (2 years ago)
Author:
takayama
Message:

Fixed BugId: 46443

* Added translate phrase
* Added translation call to the MTAssetType

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/wheeljack/php/lib/function.MTAssetType.php

    r821 r1021  
    11<?php 
    22function smarty_function_MTAssetType($args, &$ctx) { 
     3    global $mt; 
     4    $lang = $mt->config['DefaultLanguage']; 
     5    if (!preg_match('/^en/i', $lang)) 
     6        @require_once("l10n_$lang.php"); 
     7    else 
     8        @require_once("l10n_en.php"); 
     9 
    310    $asset = $ctx->stash('asset'); 
    411    if (!$asset) return ''; 
    512 
    6     return $asset['asset_class']
     13    return translate_phrase($asset['asset_class'])
    714} 
    815?> 
  • branches/wheeljack/php/lib/l10n_ja.php

    r50 r1021  
    11<?php 
    2 $Lexicon_ja = array( 
     2global $Lexicon; 
     3$Lexicon = array( 
    34    ## default_templates.pl 
    45    'Continue reading' => '続きを読む', 
     
    8081    'Continuing the discussion...' => 'トラックバック', 
    8182    'from' => ',', 
     83    'file' => 'ファむル', 
     84    'image' => '画像', 
    8285); 
     86 
    8387function translate_phrase($str, $params = null) { 
    84     global $Lexicon, $Lexicon_ja
    85     $l10n_str = isset($Lexicon_ja[$str]) ? $Lexicon_ja[$str] : isset($Lexicon[$str]) ? $Lexicon[$str] : $str; 
     88    global $Lexicon
     89    $l10n_str = isset($Lexicon[$str]) == true ? $Lexicon[$str] : $str; 
    8690    if (extension_loaded('mbstring')) { 
    8791        $str = mb_convert_encoding($l10n_str,mb_internal_encoding(),"UTF-8");