Passed
Push — master ( a02cde...eb9e44 )
by Jean-Christophe
09:52
created

Translator::loadCatalogue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Ubiquity\translation;
4
5
/**
6
 * Injectable translator (to use with di)
7
 * @author jcheron <[email protected]>
8
 * @version 1.0.1
9
 */
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
	
42
	/**
43
	 * @return mixed
44
	 */
45
	public function getFallbackLocale() {
46
		return $this->manager->getFallbackLocale();
47
	}
48
	
49
	/**
50
	 * @param mixed $fallbackLocale
51
	 */
52
	public function setFallbackLocale($fallbackLocale) {
53
		$this->manager->setFallbackLocale($fallbackLocale);
54
	}
55
	
56
	public function clearCache(){
57
		$this->manager->clearCache();
58
	}
59
}
60
61