本文整理汇总了PHP中Translation::getLang方法的典型用法代码示例。如果您正苦于以下问题:PHP Translation::getLang方法的具体用法?PHP Translation::getLang怎么用?PHP Translation::getLang使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Translation
的用法示例。
在下文中一共展示了Translation::getLang方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addTranslation
public function addTranslation(Translation $translation)
{
if (!in_array($translation->getLocale(), $this->translationLangs)) {
$this->translationLangs[] = $translation->getLang();
$this->translations->add($translation);
} else {
throw new ExistingTranslationException(sprintf('Project %s already has a translation for language: %s.', $this->caption, $translation->getLang()));
}
}
示例2: header
// If config file is NOT present, redirect to installation process.
if (!is_file(LIB . 'static/config.php')) {
header("Location: ./install/");
}
error_reporting(E_ALL & ~E_NOTICE);
/*
*= INCLUDES: DO NOT DELETE ANY OF THESE LINES. =*
*/
// Config
require LIB . 'static/config.php';
define('PREFIX', $DBCRED['prefix']);
// Base
require LIB . 'static/definitions.php';
// Languages
require LIB . 'translations/Translation.php';
define('LANG', Translation::getLang());
define('LANGS', LIB . 'translations/');
require LANGS . 'GeneralT.php';
GeneralT::init();
// Classes
require LIB . 'base/InfoMessage.php';
require LIB . 'base/AdminInfoMessage.php';
require LIB . 'themes/scss/scss.inc.php';
// Auto-Loader
require LIB . 'common/ClassLoader.php';
// Connect to database
$db = new Database($DBCRED['host'], $DBCRED['username'], $DBCRED['password'], $DBCRED['database']);
// Unset $DBCRED for security reasons
unset($DBCRED);
$userManager = new UserManager();
$user = $userManager->getUser();