本文整理汇总了PHP中Translate::t方法的典型用法代码示例。如果您正苦于以下问题:PHP Translate::t方法的具体用法?PHP Translate::t怎么用?PHP Translate::t使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Translate
的用法示例。
在下文中一共展示了Translate::t方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: t
function t($key)
{
echo Translate::t($key);
}
示例2: Translate
// define('APP_LANG', 'fr');
// setlocale(LC_ALL, 'fr_FR');
// AUTO LOAD MODELS
include 'models/helpers.php';
include 'models/class.phpmailer.php';
include 'models/class.smtp.php';
include 'models/rb.php';
spl_autoload_register(function ($class) {
if (file_exists("models/{$class}.php")) {
include "models/{$class}.php";
}
});
// LOAD TRANSLATION
$lang = new Translate();
// APPLICATION SETTINGS
define('APP_NAME', $lang->t('app|name'));
define('APP_DESC', $lang->t('app|desc'));
define('APP_AUTHOR', 'Elinore Tenorio (elinore.tenorio@gmail.com)');
define('APP_MODE', 'development');
// set to 'production' if site is live, affects RedBean not being frozen if not in correct mode
define('APP_THEME', 'default');
// set to the theme folder name you are using, found in /views directory
// TIMEZONE
date_default_timezone_set($lang->t('app|timezone'));
/*
****************************************************
* USER SETTINGS
* You are free to modify the settings below
* to suit your needs
****************************************************
*/
示例3: Translate
<?php
$page_content = ob_get_contents();
ob_end_clean();
$translate = new Translate($root_folder . 'translations/', Registry::getInstance()->getLanguage());
$newtext = $translate->t($page_content);
echo $newtext;
// $translate->getWords($yandex_translate_key);
if ($MV) {
mysqli_close($MV);
}