本文整理匯總了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: