1 | <?php |
||
16 | abstract class AbstractTranslator |
||
17 | { |
||
18 | /** |
||
19 | * The locale to use. |
||
20 | * |
||
21 | * @var string |
||
22 | * @since 2.0.0 |
||
23 | */ |
||
24 | protected $locale = 'en'; |
||
25 | |||
26 | /** |
||
27 | * Sets the locale. |
||
28 | * |
||
29 | * @param string $locale The locale to set. |
||
30 | * |
||
31 | * @return void |
||
32 | * |
||
33 | * @since 2.0.0 |
||
34 | */ |
||
35 | 279 | public function setLocale($locale) |
|
39 | |||
40 | /** |
||
41 | * Returns a translated item. |
||
42 | * |
||
43 | * @param string $item The item to translate. |
||
44 | * @param array $replace An replace array. |
||
45 | * |
||
46 | * @return string |
||
47 | * |
||
48 | * @since 2.0.0 |
||
49 | */ |
||
50 | abstract public function get($item, array $replace = array()); |
||
51 | |||
52 | /** |
||
53 | * Returns a translated item with a proper form for pluralization. |
||
54 | * |
||
55 | * @param string $item The item to translate. |
||
56 | * @param integer $number Number of items for pluralization. |
||
57 | * @param array $replace An replace array. |
||
58 | * |
||
59 | * @return string |
||
60 | * |
||
61 | * @since 2.0.0 |
||
62 | */ |
||
63 | abstract public function choice($item, $number, array $replace = array()); |
||
64 | } |
||
65 |