1 | <?php |
||
26 | class Loader { |
||
27 | /** |
||
28 | * Loader instance |
||
29 | * |
||
30 | * @access private |
||
31 | * @static |
||
32 | * @var Loader |
||
33 | */ |
||
34 | private static $_instance; |
||
35 | |||
36 | /** |
||
37 | * Default gettext domain to use. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | private $default_domain = ''; |
||
42 | |||
43 | /** |
||
44 | * Configured locale. |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | private $locale = ''; |
||
49 | |||
50 | /** |
||
51 | * Loaded domains |
||
52 | * |
||
53 | * @var array |
||
54 | */ |
||
55 | private $domains = array(); |
||
56 | |||
57 | /** |
||
58 | * Bound paths for domains |
||
59 | * |
||
60 | * @var array |
||
61 | */ |
||
62 | private $paths = array('' => './'); |
||
63 | |||
64 | /** |
||
65 | * Returns the singleton Loader object |
||
66 | * |
||
67 | * @return Loader object |
||
68 | */ |
||
69 | 3 | public static function getInstance() |
|
76 | |||
77 | /** |
||
78 | * Loads global localizaton functions. |
||
79 | * |
||
80 | * @return void |
||
81 | */ |
||
82 | 2 | public static function load_functions() |
|
86 | |||
87 | /** |
||
88 | * Figure out all possible locale names and start with the most |
||
89 | * specific ones. I.e. for sr_CS.UTF-8@latin, look through all of |
||
90 | * sr_CS.UTF-8@latin, sr_CS@latin, sr@latin, sr_CS.UTF-8, sr_CS, sr. |
||
91 | * |
||
92 | * @param string $locale Locale code |
||
93 | * |
||
94 | * @return array list of locales to try for any POSIX-style locale specification. |
||
95 | */ |
||
96 | 18 | public static function list_locales($locale) { |
|
142 | |||
143 | /** |
||
144 | * Returns Translator object for domain or for default domain |
||
145 | * |
||
146 | * @param string $domain Translation domain |
||
147 | * |
||
148 | * @return Translator |
||
149 | */ |
||
150 | public function get_translator($domain = '') |
||
181 | |||
182 | /** |
||
183 | * Sets the path for a domain. |
||
184 | * |
||
185 | * @param string $domain Domain name |
||
186 | * @param string $path Path where to find locales |
||
187 | * |
||
188 | * @return void |
||
189 | */ |
||
190 | public function bindtextdomain($domain, $path) |
||
194 | |||
195 | /** |
||
196 | * Sets the default domain. |
||
197 | * |
||
198 | * @param string $domain Domain name |
||
199 | * |
||
200 | * @return void |
||
201 | */ |
||
202 | public function textdomain($domain) |
||
206 | |||
207 | /** |
||
208 | * Sets a requested locale |
||
209 | * |
||
210 | * @param string $locale Locale name |
||
211 | * |
||
212 | * @return string Set or current locale |
||
213 | */ |
||
214 | public function setlocale($locale) |
||
225 | } |
||
226 |