Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
Translator.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ubiquity\translation
;
4
10
class
Translator
{
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
Ubiquity\translation\Translator
Injectable translator (to use with di)
Definition
Translator.php:10
Ubiquity\translation\Translator\setLocale
setLocale($locale)
Definition
Translator.php:18
Ubiquity\translation\Translator\setRootDir
setRootDir($rootDir=null)
Definition
Translator.php:22
Ubiquity\translation\Translator\$manager
$manager
Definition
Translator.php:11
Ubiquity\translation\Translator\loadCatalogue
loadCatalogue($locale=null)
Definition
Translator.php:38
Ubiquity\translation\Translator\__construct
__construct($locale="en_EN", $fallbackLocale=null, $rootDir=null)
Definition
Translator.php:13
Ubiquity\translation\Translator\setFallbackLocale
setFallbackLocale($fallbackLocale)
Definition
Translator.php:52
Ubiquity\translation\Translator\trans
trans($id, array $parameters=array(), $domain=null, $locale=null)
Definition
Translator.php:30
Ubiquity\translation\Translator\clearCache
clearCache()
Definition
Translator.php:56
Ubiquity\translation\Translator\getCatalogue
getCatalogue(&$locale=null)
Definition
Translator.php:34
Ubiquity\translation\Translator\getLocale
getLocale()
Definition
Translator.php:26
Ubiquity\translation\Translator\getFallbackLocale
getFallbackLocale()
Definition
Translator.php:45
Ubiquity\translation\TranslatorManager
Manage translations.
Definition
TranslatorManager.php:20
Ubiquity\translation
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity
src
Ubiquity
translation
Translator.php
Generated on Sun Dec 10 2023 15:04:25 for
Ubiquity
by
doxygen
1.9.8