1 <?php
2
3 /*
4 * This file is part of the ICanBoogie package.
5 *
6 * (c) Olivier Laviale <olivier.laviale@gmail.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace ICanBoogie;
13
14 use ICanBoogie\I18n\Locale;
15
16 class I18n
17 {
18 /**
19 * Paths were messages catalogs can be found.
20 *
21 * @var array
22 */
23 static public $load_paths = array();
24
25 static private $scope;
26 static private $scope_chain = array();
27
28 static public function push_scope($scope)
29 {
30 array_push(self::$scope_chain, self::$scope);
31
32 self::$scope = (array) $scope;
33 }
34
35 static public function pop_scope()
36 {
37 self::$scope = array_pop(self::$scope_chain);
38 }
39
40 static public function get_scope()
41 {
42 $scope = self::$scope;
43
44 if (is_array($scope))
45 {
46 $scope = implode('.', $scope);
47 }
48
49 return $scope;
50 }
51 }