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


PHP I18n::t方法代码示例

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


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

示例1: getContent

 protected function getContent()
 {
     $content = '<ol class="breadcrumb">
               <li><a href="' . ROOT_DIR . 'admin/courseadmin">' . I18n::t('courseoverview.title') . '</a></li>
               <li><a href="' . ROOT_DIR . 'admin/lessonadmin/' . $this->course->getId() . '">' . $this->course->getName(I18n::getLang()) . '</a></li>
               <li class="active">' . $this->lesson->getName(I18n::getLang()) . '</li>
             </ol>';
     $content .= '<form method="post"><input type="hidden" name="action" value="saveExercises" />
 <table id="exercise-admin-table" class="table table-hover">
 <thead>
 <tr>
 <th>' . I18n::t('admin.exerciseadmin.question') . '</th>
 <th>' . I18n::t('admin.exerciseadmin.answer') . ' (EN)</th>
 <th>' . I18n::t('admin.exerciseadmin.answer') . ' (DE)</th>
 <th>&nbsp;</th>
 </tr>
 </thead>
 <tbody>';
     foreach ((array) Exercise::getMultipleExercises($this->lesson->getId(), 50, 0) as $exercise) {
         $content .= '<tr><input type="hidden" name="exercise_id[]" value="' . $exercise->getId() . '" />
   <td><input type="text" name="question[]" value="' . $exercise->getQuestion() . '" /></td>
   <td><input type="text" name="answer_en[]" value="' . $exercise->getAnswer('en') . '" /></td>
   <td><input type="text" name="answer_de[]" value="' . $exercise->getAnswer('de') . '" /></td>
   </tr>';
     }
     $content .= '</tbody>
 </table>
 <table width="100%">
 <tr><td width="50%" align="left"><button id="exercise-add-btn" class="btn btn-default" type="button">' . I18n::t('button.add') . '</button></td>
 <td width="50%" align="right"><input type="submit" class="btn btn-default" value="' . I18n::t('button.save') . '" /></td></tr>
 </table>
 </form>';
     return $content;
 }
开发者ID:stoeffu,项目名称:hiragana.ch,代码行数:34,代码来源:exerciseadminview.class.php

示例2: Index

 public function Index()
 {
     if ($this->request->isPost()) {
         if (Config::$authentication['authentication']) {
             $server = isset(Config::$server['server']) && !empty(Config::$server['server']) ? Config::$server['server'] : Config::$server['host'] . ':' . Config::$server['port'];
             $db = $this->request->getParam('db');
             $options = array('username' => $this->request->getParam('username'), 'password' => $this->request->getParam('password'), 'db' => !empty($db) ? $db : 'admin');
             $mongo = PHPMongoDB::getInstance($server, $options);
             if ($mongo->getConnection()) {
                 $seesion = Application::getInstance('Session');
                 $seesion->isLogedIn = TRUE;
                 $seesion->server = $server;
                 $seesion->options = $options;
                 $this->request->redirect(Theme::URL('Index/Index'));
             } else {
                 $this->message->error = $mongo->getExceptionMessage();
             }
         } else {
             if ($this->request->getParam('username') == Config::$authentication['user'] && $this->request->getParam('password') == Config::$authentication['password']) {
                 $server = isset(Config::$server['server']) && !empty(Config::$server['server']) ? Config::$server['server'] : Config::$server['host'] . ':' . Config::$server['port'];
                 $seesion = Application::getInstance('Session');
                 $seesion->isLogedIn = TRUE;
                 $seesion->server = $server;
                 $seesion->options = array();
                 $this->request->redirect(Theme::URL('Index/Index'));
             } else {
                 $this->message->error = I18n::t('AUTH_FAIL');
             }
         }
     }
     $data = array();
     $this->display('index', $data);
 }
开发者ID:andrewyang96,项目名称:phpmongodb,代码行数:33,代码来源:Login.php

示例3: isReadonly

 public function isReadonly()
 {
     if (Application::isReadonly()) {
         $this->message->error = I18n::t('I_A');
         $this->request->redirect(Theme::URL('Index/Index'));
     }
 }
开发者ID:andrewyang96,项目名称:phpmongodb,代码行数:7,代码来源:Controller.php

示例4: getContent

 protected function getContent()
 {
     $content = '<ol class="breadcrumb">
               <li><a href="' . ROOT_DIR . 'courseoverview">' . I18n::t('courseoverview.title') . '</a></li>
               <li><a href="' . ROOT_DIR . 'course/' . $this->course->getId() . '">' . $this->course->getName(I18n::getLang()) . '</a></li>
               <li><a href="' . ROOT_DIR . 'lesson/' . $this->lesson->getId() . '">' . $this->lesson->getName(I18n::getLang()) . '</a></li>
               <li class="active">' . I18n::t('exercises.title') . '</li>
             </ol>';
     $content .= '<h1>' . $this->lesson->getName(I18n::getLang()) . ': ' . I18n::t('exercises.title') . '</h1>
 <p>
   &nbsp;
 </p>
 <form method="post" class="form-horizontal"><input type="hidden" name="action" value="evaluate" />
   <div class="form-group">
     <label for="inputPassword3" class="col-sm-3 control-label">' . $this->question . '</label>
     <div class="col-sm-9">
       <input type="text" class="form-control" name="answer" placeholder="' . I18n::t('exercise.youranswer') . '">
     </div>
   </div>
   <div class="form-group">
     <div class="col-sm-offset-3 col-sm-9">
       <button type="submit" class="btn btn-default">' . I18n::t('button.submit') . '</button>
     </div>
   </div>
 </form>';
     return $content;
 }
开发者ID:stoeffu,项目名称:hiragana.ch,代码行数:27,代码来源:exerciseview.class.php

示例5: GetLogMessage

 public function GetLogMessage($msgId, $params = "")
 {
     $message = isset($this->m_Messages[$msgId]) ? $this->m_Messages[$msgId] : constant($msgId);
     $message = I18n::t($message, $msgId, 'eventlog');
     $params = unserialize($params);
     $result = vsprintf($message, $params);
     return $result;
 }
开发者ID:Why-Not-Sky,项目名称:cubi-ng,代码行数:8,代码来源:eventlogService.php

示例6: getGlossaryTypes

 static function getGlossaryTypes()
 {
     # Type definition
     $arr_types = array('lexicon' => (object) array('label' => I18n::t('Словник'), 'slug' => I18n::t('lexicon', 'URL slug')));
     # Run filter
     $arr_types = Apply_Filters('glossary_types', $arr_types);
     return $arr_types;
 }
开发者ID:andyUA,项目名称:kabmin-new,代码行数:8,代码来源:class.glossary-type.php

示例7: addOptionsPage

 static function addOptionsPage()
 {
     $handle = Add_Options_Page(I18n::t('Glossary Options'), I18n::t('Glossary'), 'manage_options', self::$page_slug, array(__CLASS__, 'printOptionsPage'));
     # Add JavaScript to this handle
     Add_Action('load-' . $handle, array(__CLASS__, 'loadOptionsPage'));
     # Add option boxes
     self::addOptionBox(__('General'), Core::$plugin_folder . '/options-page/box-general.php');
     self::addOptionBox(I18n::t('Archive Url'), Core::$plugin_folder . '/options-page/box-archive-link.php', 'side');
 }
开发者ID:andyUA,项目名称:kabmin-new,代码行数:9,代码来源:class.options.php

示例8: forceClearance

 public static function forceClearance($roles, $user, $params = array(), $error = 'error.insufficient_rights')
 {
     $app_url = Settings::getProtected('app_url');
     $i18n = new I18n("../translations", Settings::getProtected('language'));
     if (!self::verify($roles, $user, $params)) {
         Utils::redirectToDashboard('', $i18n->t($error));
         return false;
     }
     return true;
 }
开发者ID:hmmbug,项目名称:unbindery,代码行数:10,代码来源:RoleController.class.php

示例9: addDeleteConfirmation

 public function addDeleteConfirmation()
 {
     $this->addContentBefore('<form method="post">
   <a class="btn btn-default" href="' . ROOT_DIR . 'admin/courseadmin">' . I18n::t('button.cancel') . '</a>
   <input type="hidden" name="action" value="deleteLesson" />
   <input type="hidden" name="confirmed" value="true" />
   <input type="hidden" name="lessonId" value="' . $_POST['lessonId'] . '" />
   <input type="submit" class="btn btn-danger" value="' . I18n::t('button.delete') . '" />
 </form>');
 }
开发者ID:stoeffu,项目名称:hiragana.ch,代码行数:10,代码来源:lessonadminview.class.php

示例10: translate

 /**
  * Translate error message
  * 
  * @param string $string    String to translate
  * @param array $opt        Array of arguments to pass to the translation (like field name)
  * @return string           The translated string if exists else the original string
  */
 protected function translate($string, $opt = array())
 {
     $args = !empty($this->fullName) ? array('name' => $this->fullName) : array('name' => $this->fieldName);
     $args = array_merge($args, $opt);
     $moduleName = get_module_name(get_class($this));
     if ($moduleName !== null) {
         $file = MODULES_DIR . DS . $moduleName . DS . 'i18n' . DS . 'rules.' . I18n::getLang() . '.xml';
     } else {
         $file = FW_DIR . DS . 'form' . DS . 'check' . DS . 'i18n' . DS . 'rules.' . I18n::getLang() . '.xml';
     }
     return I18n::t($file, $string, $args, 'en', 'rules', true);
 }
开发者ID:salomalo,项目名称:php-oxygen,代码行数:19,代码来源:abstract.class.php

示例11: SetLanguage

 public function SetLanguage()
 {
     $this->isReadonly();
     $language = $this->request->getParam('language');
     $languages = Config::$language;
     //$this->debug($languages);
     if (array_key_exists($language, $languages)) {
         $session = new Session();
         $session->language = $language;
     } else {
         $this->message->error = I18n::t('LAN_NOT_AVA');
     }
     $this->request->redirect($_SERVER['HTTP_REFERER']);
 }
开发者ID:andrewyang96,项目名称:phpmongodb,代码行数:14,代码来源:Index.php

示例12: Drop

 public function Drop()
 {
     $this->isReadonly();
     $db = $this->request->getParam('db');
     if (!empty($db)) {
         $response = $this->getModel()->dropDatabase($db);
         if ($response['ok'] == 1) {
             $this->message->sucess = I18n::t('D_D', $db);
         } else {
             $this->message->error = $response;
         }
     }
     $this->gotoDatabse();
 }
开发者ID:andrewyang96,项目名称:phpmongodb,代码行数:14,代码来源:Database.php

示例13: addNewCourseInput

 public function addNewCourseInput()
 {
     $this->addContentAfter('<form method="post">
   <input type="hidden" name="action" value="saveNewCourse" />
   <table class="table">
     <tr>
       <td>' . I18n::t('text.new') . '</td>
       <td><input type="text" name="nameEN" placeholder="Name EN" /></td>
       <td><input type="text" name="nameDE" placeholder="Name DE" /></td>
       <td><input type="submit" class="btn btn-default" value="' . I18n::t('button.save') . '" /></td>
     </tr>
   </table>
 </form>');
 }
开发者ID:stoeffu,项目名称:hiragana.ch,代码行数:14,代码来源:courseadminview.class.php

示例14: validate

 public function validate($val)
 {
     if (filter_var($val, FILTER_VALIDATE_EMAIL) === false) {
         if (class_exists("I18n")) {
             $err_msg = I18n::t("makiavelo.entities.errors.email");
         } else {
             $err_msg = " doesn't have a valid e-mail format";
         }
         $this->setErrorMsg($err_msg);
         return false;
     } else {
         return true;
     }
 }
开发者ID:quyen91,项目名称:lfpr,代码行数:14,代码来源:EmailValidatorClass.php

示例15: validate

 public function validate($val)
 {
     Makiavelo::info("Validating if '{$val}' is numeric...");
     if (!is_numeric($val)) {
         if (class_exists("I18n")) {
             $err_msg = I18n::t("makiavelo.entities.errors.integer");
         } else {
             $err_msg = " must be an integer";
         }
         $this->setErrorMsg($err_msg);
         return false;
     }
     return true;
 }
开发者ID:quyen91,项目名称:lfpr,代码行数:14,代码来源:IntegerValidatorClass.php


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