Commit 4d346d2
authored
Add Translation resource (#495)
Following the API documentation (https://developer.zendesk.com/api-reference/help_center/help-center-api/translations), this will enable CRUD operations for Article / Section / Category translations.
Notes:
- Translation lookups use the `locale`, which needs to be passed in the `id` param to `#find` / `#find!` (ie. `article.translations.find(id: 'fr-FR')`)
- The path for `#destroy` (https://developer.zendesk.com/api-reference/help_center/help-center-api/translations/#delete-translation) differs from the read paths for these objects. Curiously, the default `#destroy` seems to work on Article translations, but not for Section or Category translations. One workaround until this is resolved is to modify the path in a block
```ruby
translation = client.categories.translations.find(id: 'fr-FR')
translation.destroy do |req|
req.path = "#{client.config.url}/help_center/translations/#{translation.id}"
end
```1 parent c7647bc commit 4d346d2
File tree
4 files changed
+25
-0
lines changed- lib/zendesk_api
- spec/live
4 files changed
+25
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| 194 | + | |
194 | 195 | | |
195 | 196 | | |
| 197 | + | |
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
| |||
205 | 207 | | |
206 | 208 | | |
207 | 209 | | |
| 210 | + | |
208 | 211 | | |
209 | 212 | | |
| 213 | + | |
210 | 214 | | |
211 | 215 | | |
| 216 | + | |
212 | 217 | | |
213 | 218 | | |
214 | 219 | | |
| |||
221 | 226 | | |
222 | 227 | | |
223 | 228 | | |
| 229 | + | |
| 230 | + | |
224 | 231 | | |
225 | 232 | | |
226 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
| |||
0 commit comments