当前位置: 首页>>代码示例>>PHP>>正文


PHP Translator::translations方法代码示例

本文整理汇总了PHP中Translator::translations方法的典型用法代码示例。如果您正苦于以下问题:PHP Translator::translations方法的具体用法?PHP Translator::translations怎么用?PHP Translator::translations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Translator的用法示例。


在下文中一共展示了Translator::translations方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 public static function init()
 {
     $en = array('upgrade_tool' => 'Upgrade tool', 'upgrade_steps' => 'Upgrade steps', 'create_backup' => 'Backup creation', 'activate_maintenance_mode' => 'Maintenance activation', 'bundle_table_initialization' => 'Database initialization', 'vendor_replacement' => 'Vendor replacement', 'executing_migrations' => 'Upgrade execution', 'remove_maintenance_mode' => 'Disabling maintenance', 'start' => 'Start', 'return' => 'Return', 'close' => 'Close', 'debug_mode' => 'Debug mode', 'debug_mode_explanation' => 'The debug mode allows you to execute the update operations in an arbitrary order.');
     $fr = array('upgrade_tool' => 'Outil de mise à jour', 'upgrade_steps' => 'Étapes de la mise à jour', 'create_backup' => 'Creation d\'un backup', 'activate_maintenance_mode' => 'Activation du mode maintenance', 'bundle_table_initialization' => 'Initialisation de la base de donnée', 'vendor_replacement' => 'Remplacement du dossier vendor', 'executing_migrations' => 'Exécution de la mise à jour', 'remove_maintenance_mode' => 'Désactivation du mode maintenance', 'start' => 'Commencer', 'return' => 'Retour', 'close' => 'Fermer', 'debug_mode' => 'Mode de debug', 'debug_mode_explanation' => 'Le mode de debug vous permet d\'exécuter les opérations de mise à jour dans un ordre arbitraire.');
     $es = array('return' => 'Regresar', 'close' => 'Cerrar');
     self::$translations = array('fr' => $fr, 'en' => $en, 'es' => $es);
     self::$initialized = true;
 }
开发者ID:camagenta,项目名称:Claroline,代码行数:8,代码来源:libs.php

示例2: Translator

require_once 'apps/translator/lib/Functions.php';
if (isset($_GET['contains']) && !empty($_GET['contains'])) {
    $tr = new Translator();
    $all = $tr->translations($lang, $all);
    $items = Translator::get_by_search($all, $_GET['contains']);
    echo $tpl->render('translator/edit_search', array('items' => $items, 'name' => $info['name'], 'lang' => $lang, 'sources' => $sources, 'contains' => $_GET['contains'], 'empty' => $empty));
} elseif (isset($_GET['source']) && !empty($_GET['source'])) {
    $items = Translator::get_by_source($all, $_GET['source']);
    $tr = new Translator();
    $items = $tr->translations($lang, $items);
    echo $tpl->render('translator/edit_source', array('items' => $items, 'name' => $info['name'], 'lang' => $lang, 'sources' => $sources, 'source' => $_GET['source'], 'empty' => $empty));
} else {
    $num = isset($this->params[1]) ? $this->params[1] : 1;
    $limit = 40;
    $offset = ($num - 1) * $limit;
    if ($empty) {
        $tr = new Translator();
        $all = $tr->translations($lang, $all);
        foreach ($all as $k => $v) {
            if ($v['trans'] !== '') {
                unset($all[$k]);
            }
        }
        $items = array_slice($all, $offset, $limit);
    } else {
        $items = array_slice($all, $offset, $limit);
        $tr = new Translator();
        $items = $tr->translations($lang, $items);
    }
    echo $tpl->render('translator/edit', array('limit' => $limit, 'total' => count($all), 'items' => $items, 'count' => count($items), 'url' => '/translator/edit/' . $lang . '/%d?empty=' . $_GET['empty'], 'name' => $info['name'], 'lang' => $lang, 'sources' => $sources, 'empty' => $empty));
}
开发者ID:Selwyn-b,项目名称:elefant,代码行数:31,代码来源:edit.php


注:本文中的Translator::translations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。