本文整理汇总了PHP中TTi18n::getLocale方法的典型用法代码示例。如果您正苦于以下问题:PHP TTi18n::getLocale方法的具体用法?PHP TTi18n::getLocale怎么用?PHP TTi18n::getLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTi18n
的用法示例。
在下文中一共展示了TTi18n::getLocale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
switch ($action) {
case 'submit':
//Debug::setVerbosity( 11 );
Debug::Text('User Name: ' . $user_name, __FILE__, __LINE__, __METHOD__, 10);
if (isset($config_vars['other']['web_session_expire']) and $config_vars['other']['web_session_expire'] != '') {
$authentication->setEnableExpireSession((int) $config_vars['other']['web_session_expire']);
}
$authentication_result = $authentication->Login($user_name, $password);
if ($authentication_result === TRUE) {
$authentication->Check();
Debug::text('Login Language: ' . $language, __FILE__, __LINE__, __METHOD__, 10);
TTi18n::setCountry(TTi18n::getCountryFromLocale());
TTi18n::setLanguage($language);
TTi18n::setLocale();
TTi18n::setLocaleCookie();
Debug::text('Locale: ' . TTi18n::getLocale(), __FILE__, __LINE__, __METHOD__, 10);
$clf = TTnew('CompanyListFactory');
$clf->getByID($authentication->getObject()->getCompany());
$current_company = $clf->getCurrent();
unset($clf);
$create_new_station = FALSE;
//If this is a new station, insert it now.
if (isset($_COOKIE['StationID'])) {
Debug::text('Station ID Cookie found! ' . $_COOKIE['StationID'], __FILE__, __LINE__, __METHOD__, 10);
$slf = TTnew('StationListFactory');
$slf->getByStationIdandCompanyId($_COOKIE['StationID'], $current_company->getId());
$current_station = $slf->getCurrent();
unset($slf);
if ($current_station->isNew()) {
Debug::text('Station ID is NOT IN DB!! ' . $_COOKIE['StationID'], __FILE__, __LINE__, __METHOD__, 10);
$create_new_station = TRUE;
示例2: getLocale
function getLocale($language = NULL, $country = NULL)
{
$language = Misc::trimSortPrefix($language);
if ($language == '' and is_object($this->getCurrentUserObject()) and is_object($this->getCurrentUserObject()->getUserPreferenceObject())) {
$language = $this->getCurrentUserObject()->getUserPreferenceObject()->getLanguage();
}
if ($country == '' and is_object($this->getCurrentUserObject())) {
$country = $this->getCurrentUserObject()->getCountry();
}
if ($language != '') {
TTi18n::setLanguage($language);
}
if ($country != '') {
TTi18n::setCountry($country);
}
TTi18n::setLocale();
//Sets master locale
$retval = str_replace('.UTF-8', '', TTi18n::getLocale());
Debug::text('Locale: ' . $retval, __FILE__, __LINE__, __METHOD__, 10);
return $retval;
}