1 | <?php |
||
12 | abstract class Language { |
||
13 | |||
14 | protected static $phrases = []; |
||
15 | |||
16 | /** |
||
17 | * Add a phrase to the list |
||
18 | */ |
||
19 | |||
20 | private static function addPhrase(string $name, string $value) { |
||
21 | |||
22 | if (preg_match(REGEX_LANGUAGE_PHRASE_NAME, $name)) self::$phrases[$name] = $value; |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Load a phrases list from a file |
||
27 | * |
||
28 | * @return bool : true on success or false on failure |
||
29 | */ |
||
30 | |||
31 | public static function load(string $file_name) : bool { |
||
41 | |||
42 | /** |
||
43 | * Get a phrase |
||
44 | * |
||
45 | * @return string|false : the phrase if exists, otherwise false |
||
46 | */ |
||
47 | |||
48 | public static function get(string $name) { |
||
52 | |||
53 | /** |
||
54 | * Get the phrases array |
||
55 | */ |
||
56 | |||
57 | public static function getPhrases() : array { |
||
61 | } |
||
62 | } |
||
63 |