Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
Translator.php
Go to the documentation of this file.
1<?php
2
4
11 private $manager;
12
13 public function __construct($locale="en_EN",$fallbackLocale=null,$rootDir=null){
14 $this->manager=new TranslatorManager();
15 $this->manager->start($locale,$fallbackLocale,$rootDir);
16 }
17
18 public function setLocale($locale){
19 $this->manager->setLocale($locale);
20 }
21
22 public function setRootDir($rootDir=null){
23 $this->manager->setRootDir($rootDir);
24 }
25
26 public function getLocale(){
27 return $this->manager->getLocale();
28 }
29
30 public function trans($id, array $parameters = array(), $domain = null, $locale = null){
31 return $this->manager->trans($id,$parameters,$domain,$locale);
32 }
33
34 public function getCatalogue(&$locale = null){
35 return $this->manager->getCatalogue($locale);
36 }
37
38 public function loadCatalogue($locale = null){
39 $this->manager->loadCatalogue($locale);
40 }
41
45 public function getFallbackLocale() {
46 return $this->manager->getFallbackLocale();
47 }
48
52 public function setFallbackLocale($fallbackLocale) {
53 $this->manager->setFallbackLocale($fallbackLocale);
54 }
55
56 public function clearCache(){
57 $this->manager->clearCache();
58 }
59}
60
Injectable translator (to use with di)
__construct($locale="en_EN", $fallbackLocale=null, $rootDir=null)
setFallbackLocale($fallbackLocale)
trans($id, array $parameters=array(), $domain=null, $locale=null)