/** * Translate input message into default language defined in language settings for account. * This function should be used in case message should be translated to default language (e.g. log messages written to event log) * * @param string $message * @return string */ public static function _sys($message, $args = null) { if (!is_array($args)) { $args = func_get_args(); } $dictionary = Gpf_Lang_Dictionary::getInstance(Gpf_Lang_Dictionary::getDefaultSystemLanguage()); return self::_replaceArgs($dictionary->get($message), $args); }
/** * @throws Gpf_Exception */ private function loadSettingsFromLanguage() { $lang = Gpf_Lang_Dictionary::getInstance()->getLanguage(); if ($lang == null) { throw new Gpf_Exception('No language loaded'); } $this->thousandsSeparator = $lang->getThousandsSeparator(); $this->decimalSeparator = $lang->getDecimalSeparator(); $this->dateFormat = $lang->getDateFormat(); $this->timeFormat = $lang->getTimeFormat(); }
public function init() { $this->initLanguage(); try { $this->setLanguage(Gpf_Lang_Dictionary::getInstance()->load($this->getLanguage())); } catch (Exception $e) { } $this->loadTheme(); if (!Gpf_Session::getModule()->isThemeValid($this->theme)) { $this->setTheme(Gpf_Session::getModule()->getDefaultTheme()); } }
/** * @param Gpf_Data_IndexedRecordSet $languageRecordSet * @return Gpf_Data_IndexedRecordSet */ private function setDefaultLanguage(Gpf_Data_IndexedRecordSet $languageRecordSet) { $defaultLanguageCode = Gpf_Lang_Dictionary::getInstance()->getLanguage()->getCode(); foreach ($languageRecordSet as $languageRecord) { if ($languageRecord->get(Gpf_Db_Table_Languages::CODE) == $defaultLanguageCode) { $languageRecord->set(Gpf_Db_Table_Languages::IS_DEFAULT, Gpf::YES); } else { $languageRecord->set(Gpf_Db_Table_Languages::IS_DEFAULT, Gpf::NO); } } return $languageRecordSet; }
public function localize($message) { return Gpf_Lang_Dictionary::getInstance(Gpf_Session::getInstance()->getAuthUser()->getLanguage())->get($message); }
protected function renderDictionaryRequest() { $dictionary = Gpf_Lang_Dictionary::getInstance(); Gpf_Rpc_CachedResponse::addEncodedById($dictionary->getEncodedClientMessages(), 'langDictionary'); }