Changeset 843 for trunk/includes/Locale.php
- Timestamp:
- Jan 14, 2016, 10:25:47 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/Locale.php
r841 r843 18 18 } 19 19 20 function Translate($Text )21 { 22 if(array_key_exists($Text, $this->Data ) and ($this->Data[$Text] != ''))23 return($this->Data[$ Text]);20 function Translate($Text, $Group = '') 21 { 22 if(array_key_exists($Text, $this->Data[$Group]) and ($this->Data[$Group][$Text] != '')) 23 return($this->Data[$Group][$Text]); 24 24 else return($Text); 25 } 26 27 function TranslateReverse($Text, $Group = '') 28 { 29 $Key = array_search($Text, $this->Data[$Group]); 30 if(($Key === FALSE) or ($this->Data[$Group][$Key] == '')) return($Text); 31 else return($Key); 25 32 } 26 33 } … … 232 239 } 233 240 234 // Short named global function235 function T($Text )241 // Short named global translation function 242 function T($Text, $Group = '') 236 243 { 237 244 global $GlobalLocaleManager; 238 245 239 if(isset($GlobalLocaleManager)) return($GlobalLocaleManager->CurrentLocale->Texts->Translate($Text ));246 if(isset($GlobalLocaleManager)) return($GlobalLocaleManager->CurrentLocale->Texts->Translate($Text, $Group)); 240 247 else return($Text); 241 248 }
Note:
See TracChangeset
for help on using the changeset viewer.