コード例 #1
0
ファイル: block.translate.php プロジェクト: jaybill/Bolts
function smarty_block_translate($params, $content, $smarty, $repeat)
{
    $tpl_vars = $smarty->_tpl_vars;
    // only output on the closing tag
    if (!$repeat) {
        if (isset($content)) {
            $do_translation = true;
            if ($smarty->_tpl_vars['isAdminController'] && Bolts_Registry::get('enable_admin_localization', 'default') == '0') {
                $do_translation = false;
            }
            if ($params['replace']) {
                return Bolts_Translate::translate($tpl_vars['locale_code'], "default", $content, $params['replace'], $do_translation);
            } else {
                return Bolts_Translate::translate($tpl_vars['locale_code'], "default", $content, null, $do_translation);
            }
        }
    }
}
コード例 #2
0
ファイル: Abstract.php プロジェクト: jaybill/Bolts
 protected function _T($key, $replace = null)
 {
     return Bolts_Translate::translate($this->locale_code, 'default', $key, $replace);
 }
コード例 #3
0
ファイル: InstallController.php プロジェクト: jaybill/Bolts
 protected function _T($key, $replace = null)
 {
     // we're not actually doing the translation in the installer. we may some day.
     return Bolts_Translate::translate(null, "default", $key, $replace, false);
 }