1 | <?php |
||
18 | trait EditTranslationProxyTrait |
||
19 | { |
||
20 | |||
21 | /** |
||
22 | * Returns the list of all messages in all languages by making a CURL call. It is possible to set a language to retrieve only the associated message. |
||
23 | * |
||
24 | * @param bool $selfEdit |
||
25 | * @param string $msgInstanceName |
||
26 | * @param string $language |
||
27 | * @return array |
||
28 | * @throws Exception |
||
29 | */ |
||
30 | protected function getAllMessagesFromService($selfEdit, $msgInstanceName = "defaultTranslationService", $language = null) |
||
36 | |||
37 | /** |
||
38 | * Returns all the translation of one key by making a CURL call. |
||
39 | * |
||
40 | * @param bool $selfEdit |
||
41 | * @param string $msgInstanceName |
||
42 | * @param string $key |
||
43 | * @return array |
||
44 | * @throws Exception |
||
45 | */ |
||
46 | protected function getTranslationsForKeyFromService($selfEdit, $msgInstanceName, $key) |
||
52 | |||
53 | protected function setTranslationsForKeyFromService($selfEdit, $msgInstanceName, $key, $translations) |
||
59 | |||
60 | /** |
||
61 | * Saves many translations for one key and one language using CURL. |
||
62 | * |
||
63 | * @param bool $selfEdit |
||
64 | * @param string $msgInstanceName |
||
65 | * @param string $language |
||
66 | * @param array $translations |
||
67 | * @return boolean |
||
68 | * @throws Exception |
||
69 | */ |
||
70 | protected function setTranslationsForMessageFromService($selfEdit, $msgInstanceName, $language, $translations) |
||
76 | |||
77 | /** |
||
78 | * Saves the translation for one key and one language using CURL. |
||
79 | * |
||
80 | * @param bool $selfEdit |
||
81 | * @param string $msgInstanceName |
||
82 | * @param string $key |
||
83 | * @param string $label |
||
84 | * @param string $language |
||
85 | * @param string $delete |
||
86 | * @return boolean |
||
87 | * @throws Exception |
||
88 | */ |
||
89 | protected function setTranslationForMessageFromService($selfEdit, $msgInstanceName, $key, $label, $language, $delete) |
||
101 | |||
102 | /** |
||
103 | * Adds a new translation language using CURL. |
||
104 | * |
||
105 | * @param bool $selfEdit |
||
106 | * @param string $msgInstanceName |
||
107 | * @param string $language |
||
108 | * @return boolean |
||
109 | * @throws Exception |
||
110 | */ |
||
111 | protected function deleteTranslationFromService($selfEdit, $msgInstanceName, $key, $language = null) |
||
116 | } |
||
117 |