本文整理汇总了PHP中Translator::getTranslations方法的典型用法代码示例。如果您正苦于以下问题:PHP Translator::getTranslations方法的具体用法?PHP Translator::getTranslations怎么用?PHP Translator::getTranslations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Translator
的用法示例。
在下文中一共展示了Translator::getTranslations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: JobberSettings
// Setup settings
$jobber_settings = new JobberSettings();
if ($cache->testCache(CACHE_SITE_SETTINGS)) {
$settings = $cache->loadCache(CACHE_SITE_SETTINGS);
} else {
$settings = $jobber_settings->GetSettings();
$cache->saveCache($settings, CACHE_SITE_SETTINGS);
}
require_once APP_PATH . '_config/config.settings.php';
// Setup translations
$translator = new Translator(LANG_CODE);
//$translations = $translator->getTranslations();
if ($cache->testCache(CACHE_TRANSLATIONS . '_' . LANG_CODE)) {
$translations = $cache->loadCache(CACHE_TRANSLATIONS . '_' . LANG_CODE);
} else {
$translations = $translator->getTranslations();
$cache->saveCache($translations, CACHE_TRANSLATIONS . '_' . LANG_CODE);
}
// Setup Smarty
$smarty = new Smarty();
$smarty->template_dir = APP_PATH . '_tpl' . DIRECTORY_SEPARATOR . THEME . DIRECTORY_SEPARATOR;
$smarty->compile_dir = APP_PATH . '_tpl' . DIRECTORY_SEPARATOR . THEME . DIRECTORY_SEPARATOR . '_cache';
// Split URL - get parameters
$_app_info['params'] = array();
if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
}
if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
}
// if server is Apache: