コード例 #1
0
ファイル: Lang.class.php プロジェクト: AmineCherrai/rostanvo
 /**
  * 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);
 }
コード例 #2
0
 /**
  * @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();
 }
コード例 #3
0
ファイル: User.class.php プロジェクト: AmineCherrai/rostanvo
 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());
     }
 }
コード例 #4
0
ファイル: Impression.php プロジェクト: AmineCherrai/rostanvo
 /**
  * @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;
 }
コード例 #5
0
 public function localize($message)
 {
     return Gpf_Lang_Dictionary::getInstance(Gpf_Session::getInstance()->getAuthUser()->getLanguage())->get($message);
 }
コード例 #6
0
 protected function renderDictionaryRequest()
 {
     $dictionary = Gpf_Lang_Dictionary::getInstance();
     Gpf_Rpc_CachedResponse::addEncodedById($dictionary->getEncodedClientMessages(), 'langDictionary');
 }