1 | <?php |
||
23 | Class Translation extends Package |
||
24 | { |
||
25 | /** |
||
26 | * Upload existing translations to your Crowdin project. |
||
27 | * |
||
28 | * @param Languagefile $languagefile The translation object. |
||
29 | * @param string $language The language tag. |
||
30 | * @param boolean $importDuplicates Defines whether to add translation if there is |
||
31 | * the same translation previously added. |
||
32 | * Acceptable values are: 0 or 1. Default is 0. |
||
33 | * @param boolean $importEqualSuggestions Defines whether to add translation if it is equal to |
||
34 | * source string at Crowdin. |
||
35 | * Acceptable values are: 0 or 1. Default is 0. |
||
36 | * @param boolean $autoImproveImports Mark uploaded translations as approved. |
||
37 | * Acceptable values are: 0 or 1. Default is 0. |
||
38 | * @param boolean $xliff Specify this parameter if translations are uploaded to the project in XLIFF file format. |
||
39 | * Acceptable values are: 0 or 1. Default is 0. |
||
40 | * |
||
41 | * @see https://crowdin.com/page/api/upload-translation |
||
42 | * @since 1.0.1 |
||
43 | * |
||
44 | * @return ResponseInterface |
||
45 | */ |
||
46 | 1 | public function upload( |
|
87 | |||
88 | /** |
||
89 | * Build ZIP archive with the latest translations. Please note that this method can be invoked |
||
90 | * only once per 30 minutes (there is no such restriction for organization plans). Also API |
||
91 | * call will be ignored if there were no changes in the project since previous export. You can |
||
92 | * see whether ZIP archive with latest translations was actually build by status attribute |
||
93 | * ("built" or "skipped") returned in response. |
||
94 | * |
||
95 | * @param string $branch The name of related version branch. |
||
96 | * |
||
97 | * @since 1.0.4 |
||
98 | * @see https://crowdin.com/page/api/export |
||
99 | * |
||
100 | * @return ResponseInterface |
||
101 | */ |
||
102 | 1 | public function export(string $branch = '') : ResponseInterface |
|
114 | |||
115 | /** |
||
116 | * Download ZIP file with translations. You can choose the language of translation |
||
117 | * you need or download all of them at once. |
||
118 | * Note: If you would like to download the most recent translations you may want |
||
119 | * to use export API method before downloading. |
||
120 | * |
||
121 | * @param string $package Language code or "all" to download a bundle with translations to all languages. |
||
122 | * @param string $toPath Local path where to download the translation package. |
||
123 | * @param string $branch The name of related version branch. |
||
124 | * |
||
125 | * @since 1.0.4 |
||
126 | * @see https://crowdin.com/page/api/download |
||
127 | * |
||
128 | * @return \Psr\Http\Message\ResponseInterface |
||
129 | */ |
||
130 | 1 | public function download(string $package, string $toPath, string $branch = '') : ResponseInterface |
|
147 | |||
148 | /** |
||
149 | * Track overall translation and proofreading progresses of each target language. |
||
150 | * Default response format is XML. |
||
151 | * |
||
152 | * @see https://crowdin.com/page/api/status |
||
153 | * @since 1.0.4 |
||
154 | * |
||
155 | * @return ResponseInterface |
||
156 | */ |
||
157 | 1 | public function getStatus() : ResponseInterface |
|
162 | } |
||
163 |