ruby-lokalise-api 2.8.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODE_OF_CONDUCT.md +1 -1
- data/.github/CONTRIBUTING.md +2 -2
- data/CHANGELOG.md +46 -0
- data/Gemfile +2 -0
- data/README.md +293 -178
- data/Rakefile +6 -1
- data/lib/ruby-lokalise-api.rb +4 -0
- data/lib/ruby-lokalise-api/client.rb +18 -4
- data/lib/ruby-lokalise-api/collections/base.rb +6 -2
- data/lib/ruby-lokalise-api/collections/branch.rb +3 -1
- data/lib/ruby-lokalise-api/collections/contributor.rb +2 -0
- data/lib/ruby-lokalise-api/collections/custom_translation_status.rb +3 -1
- data/lib/ruby-lokalise-api/collections/file.rb +2 -0
- data/lib/ruby-lokalise-api/collections/key.rb +2 -0
- data/lib/ruby-lokalise-api/collections/key_comment.rb +2 -0
- data/lib/ruby-lokalise-api/collections/order.rb +2 -0
- data/lib/ruby-lokalise-api/collections/payment_card.rb +2 -0
- data/lib/ruby-lokalise-api/collections/project.rb +2 -0
- data/lib/ruby-lokalise-api/collections/project_comment.rb +2 -0
- data/lib/ruby-lokalise-api/collections/project_language.rb +2 -0
- data/lib/ruby-lokalise-api/collections/queued_process.rb +15 -0
- data/lib/ruby-lokalise-api/collections/screenshot.rb +2 -0
- data/lib/ruby-lokalise-api/collections/snapshot.rb +2 -0
- data/lib/ruby-lokalise-api/collections/system_language.rb +2 -0
- data/lib/ruby-lokalise-api/collections/task.rb +2 -0
- data/lib/ruby-lokalise-api/collections/team.rb +2 -0
- data/lib/ruby-lokalise-api/collections/team_user.rb +2 -0
- data/lib/ruby-lokalise-api/collections/team_user_group.rb +3 -1
- data/lib/ruby-lokalise-api/collections/translation.rb +2 -0
- data/lib/ruby-lokalise-api/collections/translation_provider.rb +2 -0
- data/lib/ruby-lokalise-api/collections/webhook.rb +2 -0
- data/lib/ruby-lokalise-api/connection.rb +3 -1
- data/lib/ruby-lokalise-api/data/attributes.json +28 -13
- data/lib/ruby-lokalise-api/error.rb +2 -0
- data/lib/ruby-lokalise-api/json_handler.rb +4 -0
- data/lib/ruby-lokalise-api/request.rb +10 -1
- data/lib/ruby-lokalise-api/resources/base.rb +53 -21
- data/lib/ruby-lokalise-api/resources/branch.rb +3 -1
- data/lib/ruby-lokalise-api/resources/contributor.rb +4 -2
- data/lib/ruby-lokalise-api/resources/custom_translation_status.rb +4 -2
- data/lib/ruby-lokalise-api/resources/file.rb +5 -1
- data/lib/ruby-lokalise-api/resources/key.rb +3 -1
- data/lib/ruby-lokalise-api/resources/key_comment.rb +5 -3
- data/lib/ruby-lokalise-api/resources/order.rb +4 -0
- data/lib/ruby-lokalise-api/resources/payment_card.rb +3 -1
- data/lib/ruby-lokalise-api/resources/project.rb +3 -1
- data/lib/ruby-lokalise-api/resources/project_comment.rb +3 -1
- data/lib/ruby-lokalise-api/resources/project_language.rb +5 -3
- data/lib/ruby-lokalise-api/resources/queued_process.rb +18 -0
- data/lib/ruby-lokalise-api/resources/screenshot.rb +3 -1
- data/lib/ruby-lokalise-api/resources/snapshot.rb +5 -1
- data/lib/ruby-lokalise-api/resources/system_language.rb +3 -1
- data/lib/ruby-lokalise-api/resources/task.rb +3 -1
- data/lib/ruby-lokalise-api/resources/team.rb +2 -0
- data/lib/ruby-lokalise-api/resources/team_user.rb +4 -2
- data/lib/ruby-lokalise-api/resources/team_user_group.rb +6 -3
- data/lib/ruby-lokalise-api/resources/translation.rb +3 -1
- data/lib/ruby-lokalise-api/resources/translation_provider.rb +5 -0
- data/lib/ruby-lokalise-api/resources/webhook.rb +13 -3
- data/lib/ruby-lokalise-api/rest/branches.rb +2 -0
- data/lib/ruby-lokalise-api/rest/comments.rb +7 -5
- data/lib/ruby-lokalise-api/rest/contributors.rb +7 -5
- data/lib/ruby-lokalise-api/rest/custom_translation_statuses.rb +8 -6
- data/lib/ruby-lokalise-api/rest/files.rb +5 -3
- data/lib/ruby-lokalise-api/rest/keys.rb +9 -7
- data/lib/ruby-lokalise-api/rest/languages.rb +8 -6
- data/lib/ruby-lokalise-api/rest/orders.rb +2 -0
- data/lib/ruby-lokalise-api/rest/payment_cards.rb +5 -3
- data/lib/ruby-lokalise-api/rest/projects.rb +8 -6
- data/lib/ruby-lokalise-api/rest/queued_processes.rb +26 -0
- data/lib/ruby-lokalise-api/rest/screenshots.rb +7 -5
- data/lib/ruby-lokalise-api/rest/snapshots.rb +6 -4
- data/lib/ruby-lokalise-api/rest/tasks.rb +7 -5
- data/lib/ruby-lokalise-api/rest/team_user_group.rb +6 -4
- data/lib/ruby-lokalise-api/rest/team_users.rb +6 -4
- data/lib/ruby-lokalise-api/rest/teams.rb +3 -1
- data/lib/ruby-lokalise-api/rest/translation_providers.rb +4 -2
- data/lib/ruby-lokalise-api/rest/translations.rb +5 -3
- data/lib/ruby-lokalise-api/rest/webhooks.rb +18 -5
- data/lib/ruby-lokalise-api/utils/attribute_helpers.rb +2 -0
- data/lib/ruby-lokalise-api/utils/endpoint_helpers.rb +2 -0
- data/lib/ruby-lokalise-api/utils/string_utils.rb +2 -0
- data/lib/ruby-lokalise-api/version.rb +3 -1
- data/ruby-lokalise-api.gemspec +9 -5
- data/spec/lib/ruby-lokalise-api/connection_spec.rb +10 -7
- data/spec/lib/ruby-lokalise-api/custom_json_parser_spec.rb +9 -5
- data/spec/lib/ruby-lokalise-api/error_spec.rb +15 -4
- data/spec/lib/ruby-lokalise-api/rest/branches_spec.rb +19 -5
- data/spec/lib/ruby-lokalise-api/rest/comments_spec.rb +19 -5
- data/spec/lib/ruby-lokalise-api/rest/contributors_spec.rb +18 -4
- data/spec/lib/ruby-lokalise-api/rest/custom_translation_statuses_spec.rb +18 -4
- data/spec/lib/ruby-lokalise-api/rest/files_spec.rb +21 -11
- data/spec/lib/ruby-lokalise-api/rest/keys_spec.rb +46 -26
- data/spec/lib/ruby-lokalise-api/rest/languages_spec.rb +20 -6
- data/spec/lib/ruby-lokalise-api/rest/orders_spec.rb +16 -2
- data/spec/lib/ruby-lokalise-api/rest/payment_cards_spec.rb +21 -5
- data/spec/lib/ruby-lokalise-api/rest/projects_spec.rb +18 -4
- data/spec/lib/ruby-lokalise-api/rest/queued_processes_spec.rb +57 -0
- data/spec/lib/ruby-lokalise-api/rest/screenshots_spec.rb +18 -4
- data/spec/lib/ruby-lokalise-api/rest/snapshots_spec.rb +31 -4
- data/spec/lib/ruby-lokalise-api/rest/tasks_spec.rb +18 -4
- data/spec/lib/ruby-lokalise-api/rest/team_user_groups_spec.rb +92 -6
- data/spec/lib/ruby-lokalise-api/rest/team_users_spec.rb +19 -4
- data/spec/lib/ruby-lokalise-api/rest/teams_spec.rb +2 -0
- data/spec/lib/ruby-lokalise-api/rest/translation_providers_spec.rb +9 -2
- data/spec/lib/ruby-lokalise-api/rest/translations_spec.rb +20 -6
- data/spec/lib/ruby-lokalise-api/rest/webhooks_spec.rb +54 -2
- data/spec/lib/ruby-lokalise-api/utils/snakecase_spec.rb +2 -0
- data/spec/lib/ruby-lokalise-api_spec.rb +12 -9
- data/spec/spec_helper.rb +8 -1
- data/spec/support/test_client.rb +2 -0
- data/spec/support/vcr.rb +2 -0
- metadata +59 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0454c459770b754104d8ff3c40ea857176d3642fd48819f2395c021c89ed1ec
|
4
|
+
data.tar.gz: 97dc4a77f36ab857edd8da3e0d2ec192fe87696485965379c20189d5911cb9c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec8413f84b1fae0a3aeb08f5393dd816f3928c174d7f181b4080bf30d441f84c2f6e071826a1a14eaa692283a1d9446734c53d7393a961d19606721a1ec56841
|
7
|
+
data.tar.gz: 6a0d6cf801b0a4adda4aa0eb7a7bef55e1009f382d1d977508a8ff605c65502f18a277c6ec0014b44ec1d2656304021b30d5bd5d3672d4888273b4a4066d9061
|
data/.github/CODE_OF_CONDUCT.md
CHANGED
@@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
|
|
34
34
|
|
35
35
|
## Enforcement
|
36
36
|
|
37
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hello@lokalise.
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hello@lokalise.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
38
38
|
|
39
39
|
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
40
40
|
|
data/.github/CONTRIBUTING.md
CHANGED
@@ -10,5 +10,5 @@
|
|
10
10
|
8. [Submit a pull request.][pr]
|
11
11
|
|
12
12
|
[fork]: http://help.github.com/fork-a-repo/
|
13
|
-
[branch]:
|
14
|
-
[pr]:
|
13
|
+
[branch]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-branches
|
14
|
+
[pr]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,51 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 3.1.0 (08-Jul-20)
|
4
|
+
|
5
|
+
* Added all recently introduced attributes for the following endpoints: `Contributor` and `Key`
|
6
|
+
* Better support for method chaining and data reloading
|
7
|
+
* API now supports only background file uploads, and the `queue` parameter doesn't have any effect anymore. Therefore, removed all code and docs related to sync uploading.
|
8
|
+
|
9
|
+
## 3.0.0 (18-May-20)
|
10
|
+
|
11
|
+
* **Breaking change** Uploading files in the background is now a preferred method, and the only method in version 3. Synchronous uploading is still supported and allowed in version 2 but will be removed in the near future. Find more info [in the docs](https://github.com/lokalise/ruby-lokalise-api#upload-translation-file).
|
12
|
+
* Added support for [background import](https://github.com/lokalise/ruby-lokalise-api#upload-translation-file). Background import will return a queued process with the status of the job:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
queued_process = @client.upload_file project_id,
|
16
|
+
data: 'Base-64 encoded data... ZnI6DQogI...',
|
17
|
+
filename: 'my_file.yml',
|
18
|
+
lang_iso: 'en'
|
19
|
+
|
20
|
+
queued_process.status # => 'queued'
|
21
|
+
# ...after some time...
|
22
|
+
queued_process = queued_process.reload_data
|
23
|
+
queued_process.status # => 'finished'
|
24
|
+
```
|
25
|
+
|
26
|
+
* Added support for [`QueuedProcess` endpoint](https://app.lokalise.com/api2docs/curl/#resource-queued-processes)
|
27
|
+
* Many resources now respond to the `reload_data` method which fetches new data from the API
|
28
|
+
* Various code improvements
|
29
|
+
* Test against more recent Rubies
|
30
|
+
* Fixed documentation links in code comments
|
31
|
+
|
32
|
+
## 2.10.0 (28-Feb-20)
|
33
|
+
|
34
|
+
* Added methods to [regenerate webhook secret](https://lokalise.com/api2docs/curl/#transition-regenerate-a-webhook-secret-patch):
|
35
|
+
+ `@client.regenerate_webhook_secret(project_id, webhook_id)`
|
36
|
+
+ `webhook.regenerate_secret`
|
37
|
+
* API base URL is now `https://api.lokalise.com/api2/` instead of `https://api.lokalise.co/api2/`
|
38
|
+
|
39
|
+
## 2.9.0.1 (21-Jan-20)
|
40
|
+
|
41
|
+
* Make JSON dependency version less strict
|
42
|
+
* Test against Ruby 2.7.0
|
43
|
+
|
44
|
+
## 2.9.0 (05-Jan-20)
|
45
|
+
|
46
|
+
* Fixed a couple of bugs
|
47
|
+
* Updated Faraday to version 1
|
48
|
+
|
3
49
|
## 2.8.0 (13-Nov-19)
|
4
50
|
|
5
51
|
* Added methods to [merge branches](https://lokalise.com/api2docs/curl/#transition-merge-a-branch-post):
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/ruby-lokalise-api.svg)](https://badge.fury.io/rb/ruby-lokalise-api)
|
4
4
|
[![Build Status](https://travis-ci.org/lokalise/ruby-lokalise-api.svg?branch=master)](https://travis-ci.org/lokalise/ruby-lokalise-api)
|
5
|
+
[![Test Coverage](https://codecov.io/gh/lokalise/ruby-lokalise-api/graph/badge.svg)](https://codecov.io/gh/lokalise/ruby-lokalise-api)
|
5
6
|
|
6
|
-
Official opinionated Ruby interface for the [Lokalise API](https://lokalise.com/api2docs/curl/) that represents returned data as Ruby objects.
|
7
|
+
Official opinionated Ruby interface for the [Lokalise API](https://app.lokalise.com/api2docs/curl/) that represents returned data as Ruby objects.
|
7
8
|
|
8
9
|
## Index
|
9
10
|
|
@@ -17,12 +18,13 @@ Official opinionated Ruby interface for the [Lokalise API](https://lokalise.com/
|
|
17
18
|
+ [Branches](#branches)
|
18
19
|
+ [Comments](#comments)
|
19
20
|
+ [Contributors](#contributors)
|
20
|
-
+ [Files](#files)
|
21
|
+
+ [Files](#translation-files)
|
21
22
|
+ [Keys](#keys)
|
22
23
|
+ [Languages](#languages)
|
23
24
|
+ [Orders](#orders)
|
24
25
|
+ [Payment cards](#payment-cards)
|
25
26
|
+ [Projects](#projects)
|
27
|
+
+ [Queued processes](#queued-processes)
|
26
28
|
+ [Screenshots](#screenshots)
|
27
29
|
+ [Snapshots](#snapshots)
|
28
30
|
+ [Tasks](#tasks)
|
@@ -79,6 +81,14 @@ project.description
|
|
79
81
|
project.created_by
|
80
82
|
```
|
81
83
|
|
84
|
+
Many resources have common methods like `project_id` and `branch`:
|
85
|
+
|
86
|
+
```ruby
|
87
|
+
webhook = client.webhook project_id, '123.abc'
|
88
|
+
webhook.project_id
|
89
|
+
webhook.branch
|
90
|
+
```
|
91
|
+
|
82
92
|
To get access to raw data returned by the API, use `#raw_data`:
|
83
93
|
|
84
94
|
```ruby
|
@@ -91,6 +101,18 @@ Models support method chaining, meaning you can fetch a resource, update and del
|
|
91
101
|
@client.project('123').update(name: 'New name').destroy
|
92
102
|
```
|
93
103
|
|
104
|
+
#### Reloading data
|
105
|
+
|
106
|
+
Most of the resources can be reloaded using the `reload_data` method. This method will fetch the latest data for the resource:
|
107
|
+
|
108
|
+
```ruby
|
109
|
+
project = client.project '123'
|
110
|
+
# do something else...
|
111
|
+
# project might be updated via UI, so load new data:
|
112
|
+
reloaded_project = project.reload_data
|
113
|
+
# now `reloaded_project` has fresh data from the API
|
114
|
+
```
|
115
|
+
|
94
116
|
### Collections of resources and pagination
|
95
117
|
|
96
118
|
Fetching (or creating/updating) multiple objects will return a *collection* of objects. To get access to the actual data, use `#collection` method:
|
@@ -100,7 +122,7 @@ project = @client.projects.collection.first # => Get the first project
|
|
100
122
|
project.name
|
101
123
|
```
|
102
124
|
|
103
|
-
Bulk fetches support [pagination](https://lokalise.com/api2docs/curl/#resource-pagination). There are two common parameters available:
|
125
|
+
Bulk fetches support [pagination](https://app.lokalise.com/api2docs/curl/#resource-pagination). There are two common parameters available:
|
104
126
|
|
105
127
|
* `:limit` (defaults to `100`, maximum is `5000`) - number of records to display per page
|
106
128
|
* `:page` (defaults to `1`) - page to fetch
|
@@ -152,11 +174,11 @@ If you are using [project branching feature](https://docs.lokalise.com/en/articl
|
|
152
174
|
|
153
175
|
### Branches
|
154
176
|
|
155
|
-
[Branches attributes](https://lokalise.com/api2docs/curl/#resource-branches)
|
177
|
+
[Branches attributes](https://app.lokalise.com/api2docs/curl/#resource-branches)
|
156
178
|
|
157
179
|
#### Fetch branches
|
158
180
|
|
159
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-branches-get)
|
181
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-branches-get)
|
160
182
|
|
161
183
|
```ruby
|
162
184
|
@client.branches(project_id, params = {}) # Input:
|
@@ -169,39 +191,39 @@ If you are using [project branching feature](https://docs.lokalise.com/en/articl
|
|
169
191
|
|
170
192
|
#### Fetch branch
|
171
193
|
|
172
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-branch-get)
|
194
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-branch-get)
|
173
195
|
|
174
196
|
```ruby
|
175
197
|
@client.branch(project_id, branch_id) # Input:
|
176
198
|
## project_id (string, required)
|
177
|
-
## branch_id (string or integer, required)
|
199
|
+
## branch_id (string or integer, required)
|
178
200
|
# Output:
|
179
201
|
## Branch inside the given project
|
180
202
|
```
|
181
203
|
|
182
204
|
#### Create branch
|
183
205
|
|
184
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-branch-get)
|
206
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-branch-get)
|
185
207
|
|
186
208
|
```ruby
|
187
209
|
@client.create_branch(project_id, params) # Input:
|
188
210
|
## project_id (string, required)
|
189
211
|
## params (hash, required):
|
190
|
-
### :name (string) - name of the branch
|
212
|
+
### :name (string) - name of the branch
|
191
213
|
# Output:
|
192
214
|
## Created branch
|
193
215
|
```
|
194
216
|
|
195
217
|
#### Update branch
|
196
218
|
|
197
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-branch-put)
|
219
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-branch-put)
|
198
220
|
|
199
221
|
```ruby
|
200
222
|
@client.update_branch(project_id, branch_id, params) # Input:
|
201
223
|
## project_id (string, required)
|
202
|
-
## branch_id (string or integer, required)
|
224
|
+
## branch_id (string or integer, required)
|
203
225
|
## params (hash, required):
|
204
|
-
### :name (string) - name of the branch
|
226
|
+
### :name (string) - name of the branch
|
205
227
|
# Output:
|
206
228
|
## Updated branch
|
207
229
|
```
|
@@ -215,12 +237,12 @@ branch.update params
|
|
215
237
|
|
216
238
|
#### Delete branch
|
217
239
|
|
218
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-branch-delete)
|
240
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-branch-delete)
|
219
241
|
|
220
242
|
```ruby
|
221
243
|
@client.destroy_branch(project_id, branch_id) # Input:
|
222
244
|
## project_id (string, required)
|
223
|
-
## branch_id (string or integer, required)
|
245
|
+
## branch_id (string or integer, required)
|
224
246
|
# Output:
|
225
247
|
## Hash with the project's id and "branch_deleted"=>true
|
226
248
|
```
|
@@ -234,13 +256,13 @@ branch.destroy
|
|
234
256
|
|
235
257
|
#### Merge branch
|
236
258
|
|
237
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-merge-a-branch-post)
|
259
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-merge-a-branch-post)
|
238
260
|
|
239
261
|
```ruby
|
240
262
|
@client.merge_branch(project_id, branch_id, params) # Input:
|
241
263
|
## project_id (string, required)
|
242
|
-
## branch_id (string or integer, required)
|
243
|
-
## params (hash)
|
264
|
+
## branch_id (string or integer, required)
|
265
|
+
## params (hash)
|
244
266
|
# Output:
|
245
267
|
## Hash with the project's id, "branch_merged"=>true, and branch attributes
|
246
268
|
```
|
@@ -254,11 +276,11 @@ branch.merge params
|
|
254
276
|
|
255
277
|
### Comments
|
256
278
|
|
257
|
-
[Comments attributes](https://lokalise.com/api2docs/curl/#resource-comments)
|
279
|
+
[Comments attributes](https://app.lokalise.com/api2docs/curl/#resource-comments)
|
258
280
|
|
259
281
|
#### Fetch project comments
|
260
282
|
|
261
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-project-comments-get)
|
283
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-project-comments-get)
|
262
284
|
|
263
285
|
```ruby
|
264
286
|
@client.project_comments(project_id, params = {}) # Input:
|
@@ -271,12 +293,12 @@ branch.merge params
|
|
271
293
|
|
272
294
|
#### Fetch key comments
|
273
295
|
|
274
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-key-comments-get)
|
296
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-key-comments-get)
|
275
297
|
|
276
298
|
```ruby
|
277
299
|
@client.comments(project_id, key_id, params = {}) # Input:
|
278
300
|
## project_id (string, required)
|
279
|
-
## key_id (string, required)
|
301
|
+
## key_id (string, required)
|
280
302
|
## params (hash)
|
281
303
|
### :page and :limit
|
282
304
|
# Output:
|
@@ -285,12 +307,12 @@ branch.merge params
|
|
285
307
|
|
286
308
|
#### Create key comments
|
287
309
|
|
288
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-comments-post)
|
310
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-comments-post)
|
289
311
|
|
290
312
|
```ruby
|
291
313
|
@client.create_comments(project_id, key_id, params) # Input:
|
292
314
|
## project_id (string, required)
|
293
|
-
## key_id (string, required)
|
315
|
+
## key_id (string, required)
|
294
316
|
## params (array or hash, required) - contains parameter of newly created comments. Pass array of hashes to create multiple comments, or a hash to create a single comment
|
295
317
|
### :comment (string, required)
|
296
318
|
# Output:
|
@@ -299,26 +321,26 @@ branch.merge params
|
|
299
321
|
|
300
322
|
#### Fetch key comment
|
301
323
|
|
302
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-comment-get)
|
324
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-comment-get)
|
303
325
|
|
304
326
|
```ruby
|
305
327
|
@client.comment(project_id, key_id, comment_id) # Input:
|
306
328
|
## project_id (string, required)
|
307
|
-
## key_id (string, required)
|
308
|
-
## comment_id (string, required)
|
329
|
+
## key_id (string, required)
|
330
|
+
## comment_id (string, required)
|
309
331
|
# Output:
|
310
332
|
## Comment for the key in the given project
|
311
333
|
```
|
312
334
|
|
313
335
|
#### Delete key comment
|
314
336
|
|
315
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-comment-delete)
|
337
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-comment-delete)
|
316
338
|
|
317
339
|
```ruby
|
318
340
|
@client.destroy_comment(project_id, key_id, comment_id) # Input:
|
319
341
|
## project_id (string, required)
|
320
|
-
## key_id (string, required)
|
321
|
-
## comment_id (string, required)
|
342
|
+
## key_id (string, required)
|
343
|
+
## comment_id (string, required)
|
322
344
|
# Output:
|
323
345
|
## Hash with the project's id and "comment_deleted"=>true
|
324
346
|
```
|
@@ -334,7 +356,7 @@ comment.destroy
|
|
334
356
|
|
335
357
|
#### Fetch contributors
|
336
358
|
|
337
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-contributors-get)
|
359
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-contributors-get)
|
338
360
|
|
339
361
|
```ruby
|
340
362
|
@client.contributors(project_id, params = {}) # Input:
|
@@ -347,7 +369,7 @@ comment.destroy
|
|
347
369
|
|
348
370
|
#### Fetch a single contributor
|
349
371
|
|
350
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-contributor-get)
|
372
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-contributor-get)
|
351
373
|
|
352
374
|
```ruby
|
353
375
|
@client.contributor(project_id, contributor_id) # Input:
|
@@ -359,39 +381,39 @@ comment.destroy
|
|
359
381
|
|
360
382
|
#### Create contributors
|
361
383
|
|
362
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-contributors-post)
|
384
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-contributors-post)
|
363
385
|
|
364
386
|
```ruby
|
365
387
|
@client.create_contributors(project_id, params) # Input:
|
366
388
|
## project_id (string, required)
|
367
389
|
## params (array of hashes or hash, required) - parameters for the newly created contributors. Pass array of hashes to create multiple contributors, or a hash to create a single contributor
|
368
390
|
### :email (string, required)
|
369
|
-
### :fullname (string)
|
391
|
+
### :fullname (string)
|
370
392
|
### :is_admin (boolean)
|
371
393
|
### :is_reviewer (boolean)
|
372
394
|
### :languages (array of hashes, required if "is_admin" set to false) - possible languages attributes:
|
373
395
|
#### :lang_iso (string, required)
|
374
|
-
#### :is_writable (boolean)
|
375
|
-
### :admin_rights (array)
|
396
|
+
#### :is_writable (boolean)
|
397
|
+
### :admin_rights (array)
|
376
398
|
# Output:
|
377
399
|
## Collection of newly created contributors
|
378
400
|
```
|
379
401
|
|
380
402
|
#### Update contributor
|
381
403
|
|
382
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-contributor-put)
|
404
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-contributor-put)
|
383
405
|
|
384
406
|
```ruby
|
385
407
|
@client.update_contributor(project_id, contributor_id, params) # Input:
|
386
408
|
## project_id (string, required)
|
387
|
-
## contributor_id (string, required)
|
409
|
+
## contributor_id (string, required)
|
388
410
|
## params (hash, required)
|
389
411
|
### :is_admin (boolean)
|
390
412
|
### :is_reviewer (boolean)
|
391
413
|
### :languages (array of hashes) - possible languages attributes:
|
392
414
|
#### :lang_iso (string, required)
|
393
|
-
#### :is_writable (boolean)
|
394
|
-
### :admin_rights (array)
|
415
|
+
#### :is_writable (boolean)
|
416
|
+
### :admin_rights (array)
|
395
417
|
# Output:
|
396
418
|
## Updated contributor
|
397
419
|
```
|
@@ -405,7 +427,7 @@ contributor.update(params)
|
|
405
427
|
|
406
428
|
#### Delete contributor
|
407
429
|
|
408
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-contributor-delete)
|
430
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-contributor-delete)
|
409
431
|
|
410
432
|
```ruby
|
411
433
|
@client.destroy_contributor(project_id, contributor_id) # Input:
|
@@ -422,13 +444,13 @@ contributor = @client.contributor('project_id', 'id')
|
|
422
444
|
contributor.destroy
|
423
445
|
```
|
424
446
|
|
425
|
-
###
|
447
|
+
### Translation files
|
426
448
|
|
427
|
-
[File attributes](https://lokalise.com/api2docs/curl/#object-files)
|
449
|
+
[File attributes](https://app.lokalise.com/api2docs/curl/#object-files)
|
428
450
|
|
429
451
|
#### Fetch translation files
|
430
452
|
|
431
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-files-get)
|
453
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-files-get)
|
432
454
|
|
433
455
|
```ruby
|
434
456
|
@client.files(project_id, params = {}) # Input:
|
@@ -441,7 +463,7 @@ contributor.destroy
|
|
441
463
|
|
442
464
|
#### Download translation files
|
443
465
|
|
444
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-download-files-post)
|
466
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-download-files-post)
|
445
467
|
|
446
468
|
Exports project files as a `.zip` bundle and makes them available to download (the link is valid for 12 months).
|
447
469
|
|
@@ -450,14 +472,16 @@ Exports project files as a `.zip` bundle and makes them available to download (t
|
|
450
472
|
## project_id (string, required)
|
451
473
|
## params (hash, required)
|
452
474
|
### :format (string, required) - one of the file formats supported by Lokalise (json, xml, po etc).
|
453
|
-
### Find the list of other supported params at https://lokalise.com/api2docs/curl/#transition-download-files-post
|
475
|
+
### Find the list of other supported params at https://app.lokalise.com/api2docs/curl/#transition-download-files-post
|
454
476
|
# Output:
|
455
477
|
## Hash with the project id and a "bundle_url" link
|
456
478
|
```
|
457
479
|
|
458
480
|
#### Upload translation file
|
459
481
|
|
460
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-upload-a-file-post)
|
482
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-upload-a-file-post)
|
483
|
+
|
484
|
+
Starting from July 2020, **background uploading is the only method of importing translation files**.
|
461
485
|
|
462
486
|
```ruby
|
463
487
|
@client.upload_file(project_id, params) # Input:
|
@@ -465,19 +489,64 @@ Exports project files as a `.zip` bundle and makes them available to download (t
|
|
465
489
|
## params (hash, required)
|
466
490
|
### :data (string, required) - base64-encoded data (the format must be supported by Lokalise)
|
467
491
|
### :filename (string, required)
|
468
|
-
### :lang_iso (string, required)
|
469
|
-
### Find the list of other supported params at https://lokalise.com/api2docs/curl/#transition-upload-a-file-post
|
492
|
+
### :lang_iso (string, required)
|
493
|
+
### Find the list of other supported params at https://app.lokalise.com/api2docs/curl/#transition-upload-a-file-post
|
470
494
|
# Output:
|
471
|
-
##
|
495
|
+
## QueuedProcess resource
|
496
|
+
```
|
497
|
+
|
498
|
+
A [`QueuedProcess`](#queued-processes) resource will be returned. This resource contains a status of the import job, process ID to manually check the status, and some other attributes:
|
499
|
+
|
500
|
+
```ruby
|
501
|
+
queued_process = @client.upload_file project_id,
|
502
|
+
data: 'Base-64 encoded data... ZnI6DQogI...',
|
503
|
+
filename: 'my_file.yml',
|
504
|
+
lang_iso: 'en'
|
505
|
+
|
506
|
+
queued_process.status # => 'queued'
|
507
|
+
queued_process.process_id # => 'ff1876382b7ba81f2bb465da8f030196ec401fa6'
|
508
|
+
```
|
509
|
+
|
510
|
+
Your job is to periodically reload data for the queued process and check the `status` attribute:
|
511
|
+
|
512
|
+
```ruby
|
513
|
+
reloaded_process = queued_process.reload_data # loads new data from the API
|
514
|
+
reloaded_process.status # => 'finished'
|
515
|
+
```
|
516
|
+
|
517
|
+
Alternatively, you may use the `queued_process` method:
|
518
|
+
|
519
|
+
```ruby
|
520
|
+
reloaded_process = @client.queued_process project_id, queued_process.process_id
|
521
|
+
```
|
522
|
+
|
523
|
+
It is up to you to decide how to poll API for changes (remember that larger files will take more time to be imported), but here's a simple example:
|
524
|
+
|
525
|
+
```ruby
|
526
|
+
def uploaded?(process)
|
527
|
+
5.times do # try to check the status 5 times
|
528
|
+
queued_process = queued_process.reload_data # load new data
|
529
|
+
return(true) if queued_process.status == 'finished' # return true is the upload has finished
|
530
|
+
sleep 1 # wait for 1 second, adjust this number with regards to the upload size
|
531
|
+
end
|
532
|
+
|
533
|
+
return false # if all 5 checks failed, return false (probably something is wrong)
|
534
|
+
end
|
535
|
+
|
536
|
+
queued_process = @client.upload_file project_id,
|
537
|
+
data: 'Base-64 encoded data... ZnI6DQogI...',
|
538
|
+
filename: 'my_file.yml',
|
539
|
+
lang_iso: 'en'
|
540
|
+
uploaded? queued_process
|
472
541
|
```
|
473
542
|
|
474
543
|
### Keys
|
475
544
|
|
476
|
-
[Key attributes](https://lokalise.com/api2docs/curl/#object-keys)
|
545
|
+
[Key attributes](https://app.lokalise.com/api2docs/curl/#object-keys)
|
477
546
|
|
478
547
|
#### Fetch project keys
|
479
548
|
|
480
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-keys-get)
|
549
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-keys-get)
|
481
550
|
|
482
551
|
```ruby
|
483
552
|
@client.keys(project_id, params = {}) # Input:
|
@@ -490,12 +559,12 @@ Exports project files as a `.zip` bundle and makes them available to download (t
|
|
490
559
|
|
491
560
|
#### Fetch a single project key
|
492
561
|
|
493
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-key-get)
|
562
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-key-get)
|
494
563
|
|
495
564
|
```ruby
|
496
565
|
@client.key(project_id, key_id, params = {}) # Input:
|
497
566
|
## project_id (string, required)
|
498
|
-
## key_id (string, required)
|
567
|
+
## key_id (string, required)
|
499
568
|
## params (hash)
|
500
569
|
### :disable_references (string) - possible values are "1" and "0".
|
501
570
|
# Output:
|
@@ -504,7 +573,7 @@ Exports project files as a `.zip` bundle and makes them available to download (t
|
|
504
573
|
|
505
574
|
#### Create project keys
|
506
575
|
|
507
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-keys-post)
|
576
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-keys-post)
|
508
577
|
|
509
578
|
```ruby
|
510
579
|
@client.create_keys(project_id, params) # Input:
|
@@ -512,21 +581,21 @@ Exports project files as a `.zip` bundle and makes them available to download (t
|
|
512
581
|
## params (array of hashes or hash, required)
|
513
582
|
### :key_name (string or hash, required) - for projects with enabled per-platform key names, pass hash with "ios", "android", "web" and "other" params.
|
514
583
|
### :platforms (array) - supported values are "ios", "android", "web" and "other"
|
515
|
-
### Find all other supported attributes at https://lokalise.com/api2docs/curl/#transition-create-keys-post
|
584
|
+
### Find all other supported attributes at https://app.lokalise.com/api2docs/curl/#transition-create-keys-post
|
516
585
|
# Output:
|
517
586
|
## Collection of newly created keys
|
518
587
|
```
|
519
588
|
|
520
589
|
#### Update project key
|
521
590
|
|
522
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-key-put)
|
591
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-key-put)
|
523
592
|
|
524
593
|
```ruby
|
525
594
|
@client.update_key(project_id, key_id, params = {}) # Input:
|
526
595
|
## project_id (string, required)
|
527
|
-
## key_id (string, required)
|
596
|
+
## key_id (string, required)
|
528
597
|
## params (hash)
|
529
|
-
### Find a list of supported attributes at https://lokalise.com/api2docs/curl/#transition-update-a-key-put
|
598
|
+
### Find a list of supported attributes at https://app.lokalise.com/api2docs/curl/#transition-update-a-key-put
|
530
599
|
# Output:
|
531
600
|
## Updated key
|
532
601
|
```
|
@@ -540,26 +609,26 @@ key.update(params)
|
|
540
609
|
|
541
610
|
#### Bulk update project keys
|
542
611
|
|
543
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-bulk-update-put)
|
612
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-bulk-update-put)
|
544
613
|
|
545
614
|
```ruby
|
546
615
|
@client.update_keys(project_id, params) # Input:
|
547
616
|
## project_id (string, required)
|
548
617
|
## params (hash or array of hashes, required)
|
549
618
|
### :key_id (string, required)
|
550
|
-
### Find all other supported attributes at https://lokalise.com/api2docs/curl/#transition-bulk-update-put
|
619
|
+
### Find all other supported attributes at https://app.lokalise.com/api2docs/curl/#transition-bulk-update-put
|
551
620
|
# Output:
|
552
621
|
## Collection of updated keys
|
553
622
|
```
|
554
623
|
|
555
624
|
#### Delete project key
|
556
625
|
|
557
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-key-delete)
|
626
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-key-delete)
|
558
627
|
|
559
628
|
```ruby
|
560
629
|
@client.destroy_key(project_id, key_id) # Input:
|
561
630
|
## project_id (string, required)
|
562
|
-
## key_id (string, required)
|
631
|
+
## key_id (string, required)
|
563
632
|
# Output:
|
564
633
|
## Hash with project_id and "key_removed" set to "true"
|
565
634
|
```
|
@@ -573,12 +642,12 @@ key.destroy
|
|
573
642
|
|
574
643
|
#### Bulk delete project keys
|
575
644
|
|
576
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-multiple-keys-delete)
|
645
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-multiple-keys-delete)
|
577
646
|
|
578
647
|
```ruby
|
579
648
|
@client.destroy_keys(project_id, key_ids) # Input:
|
580
649
|
## project_id (string, required)
|
581
|
-
## key_ids (array, required)
|
650
|
+
## key_ids (array, required)
|
582
651
|
# Output:
|
583
652
|
## Hash with project_id and "keys_removed" set to "true"
|
584
653
|
```
|
@@ -592,11 +661,11 @@ keys.destroy_all # => will effectively destroy all keys in the project
|
|
592
661
|
|
593
662
|
### Languages
|
594
663
|
|
595
|
-
[Language attributes](https://lokalise.com/api2docs/curl/#object-languages)
|
664
|
+
[Language attributes](https://app.lokalise.com/api2docs/curl/#object-languages)
|
596
665
|
|
597
666
|
#### Fetch system languages
|
598
667
|
|
599
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-system-languages-get)
|
668
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-system-languages-get)
|
600
669
|
|
601
670
|
```ruby
|
602
671
|
@client.system_languages(params = {}) # Input:
|
@@ -608,7 +677,7 @@ keys.destroy_all # => will effectively destroy all keys in the project
|
|
608
677
|
|
609
678
|
#### Fetch project languages
|
610
679
|
|
611
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-project-languages-get)
|
680
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-project-languages-get)
|
612
681
|
|
613
682
|
```ruby
|
614
683
|
@client.project_languages(project_id, params = {}) # Input:
|
@@ -621,7 +690,7 @@ keys.destroy_all # => will effectively destroy all keys in the project
|
|
621
690
|
|
622
691
|
#### Fetch a single project language
|
623
692
|
|
624
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-language-get)
|
693
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-language-get)
|
625
694
|
|
626
695
|
```ruby
|
627
696
|
@client.language(project_id, language_id) # Input:
|
@@ -633,14 +702,14 @@ keys.destroy_all # => will effectively destroy all keys in the project
|
|
633
702
|
|
634
703
|
#### Create project languages
|
635
704
|
|
636
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-languages-post)
|
705
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-languages-post)
|
637
706
|
|
638
707
|
```ruby
|
639
708
|
@client.create_languages(project_id, params) # Input:
|
640
709
|
## project_id (string, required)
|
641
710
|
## params (array of hashes or hash, required) - contains parameter of newly created languages. Pass array of hashes to create multiple languages, or a hash to create a single language
|
642
711
|
### :lang_iso (string, required)
|
643
|
-
### :custom_iso (string)
|
712
|
+
### :custom_iso (string)
|
644
713
|
### :custom_name (string)
|
645
714
|
### :custom_plural_forms (array) - can contain only plural forms initially supported by Lokalise
|
646
715
|
# Output:
|
@@ -649,16 +718,16 @@ keys.destroy_all # => will effectively destroy all keys in the project
|
|
649
718
|
|
650
719
|
#### Update project language
|
651
720
|
|
652
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-language-put)
|
721
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-language-put)
|
653
722
|
|
654
723
|
```ruby
|
655
724
|
@client.update_language(project_id, language_id, params) # Input:
|
656
725
|
## project_id (string, required)
|
657
|
-
## language_id (string, required)
|
726
|
+
## language_id (string, required)
|
658
727
|
## params (hash, required)
|
659
728
|
### :lang_iso (string, required)
|
660
729
|
### :custom_name (string)
|
661
|
-
### :plural_forms (array) - can contain only plural forms initially supported by Lokalise
|
730
|
+
### :plural_forms (array) - can contain only plural forms initially supported by Lokalise
|
662
731
|
# Output:
|
663
732
|
## Updated language
|
664
733
|
```
|
@@ -672,7 +741,7 @@ language.update(params)
|
|
672
741
|
|
673
742
|
#### Delete project language
|
674
743
|
|
675
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-language-delete)
|
744
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-language-delete)
|
676
745
|
|
677
746
|
```ruby
|
678
747
|
@client.destroy_language(project_id, language_id) # Input:
|
@@ -691,11 +760,11 @@ language.destroy
|
|
691
760
|
|
692
761
|
### Orders
|
693
762
|
|
694
|
-
[Order attributes](https://lokalise.com/api2docs/curl/#object-orders)
|
763
|
+
[Order attributes](https://app.lokalise.com/api2docs/curl/#object-orders)
|
695
764
|
|
696
765
|
#### Fetch order collection
|
697
766
|
|
698
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-orders-get)
|
767
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-orders-get)
|
699
768
|
|
700
769
|
```ruby
|
701
770
|
@client.orders(team_id, params = {}) # Input:
|
@@ -708,7 +777,7 @@ language.destroy
|
|
708
777
|
|
709
778
|
#### Fetch a single order
|
710
779
|
|
711
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-an-order-get)
|
780
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-an-order-get)
|
712
781
|
|
713
782
|
```ruby
|
714
783
|
@client.order(team_id, order_id) # Input:
|
@@ -720,7 +789,7 @@ language.destroy
|
|
720
789
|
|
721
790
|
#### Create an order
|
722
791
|
|
723
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-an-order-post)
|
792
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-an-order-post)
|
724
793
|
|
725
794
|
```ruby
|
726
795
|
@client.create_order(team_id, params) # Input:
|
@@ -729,13 +798,13 @@ language.destroy
|
|
729
798
|
### project_id (string, required)
|
730
799
|
### card_id (integer, string, required) - card to process payment
|
731
800
|
### briefing (string, required)
|
732
|
-
### source_language_iso (string, required)
|
801
|
+
### source_language_iso (string, required)
|
733
802
|
### target_language_isos (array of strings, required)
|
734
803
|
### keys (array of integers, required) - keys to include in the order
|
735
804
|
### provider_slug (string, required)
|
736
|
-
### translation_tier (integer, required)
|
805
|
+
### translation_tier (integer, required)
|
737
806
|
### dry_run (boolean) - return the response without actually placing an order. Useful for price estimation. Default is `false`
|
738
|
-
### translation_style (string) - only for gengo provider. Available values are `formal`, `informal`, `business`, `friendly`. Defaults to `friendly`.
|
807
|
+
### translation_style (string) - only for gengo provider. Available values are `formal`, `informal`, `business`, `friendly`. Defaults to `friendly`.
|
739
808
|
# Output:
|
740
809
|
## A newly created order
|
741
810
|
|
@@ -743,23 +812,23 @@ language.destroy
|
|
743
812
|
|
744
813
|
### Payment cards
|
745
814
|
|
746
|
-
[Payment card attributes](https://lokalise.com/api2docs/curl/#object-payment-cards)
|
815
|
+
[Payment card attributes](https://app.lokalise.com/api2docs/curl/#object-payment-cards)
|
747
816
|
|
748
817
|
#### Fetch payment card collection
|
749
818
|
|
750
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-cards-get)
|
819
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-cards-get)
|
751
820
|
|
752
821
|
```ruby
|
753
822
|
@client.payment_cards(params = {}) # Input:
|
754
823
|
## params (hash)
|
755
824
|
### :page and :limit
|
756
825
|
# Output:
|
757
|
-
## Collection of payment cards under the `payment_cards` attribute
|
826
|
+
## Collection of payment cards under the `payment_cards` attribute
|
758
827
|
```
|
759
828
|
|
760
829
|
#### Fetch a single payment card
|
761
830
|
|
762
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-card-get)
|
831
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-card-get)
|
763
832
|
|
764
833
|
```ruby
|
765
834
|
@client.payment_card(card_id) # Input:
|
@@ -770,7 +839,7 @@ language.destroy
|
|
770
839
|
|
771
840
|
#### Create a payment card
|
772
841
|
|
773
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-card-post)
|
842
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-a-card-post)
|
774
843
|
|
775
844
|
```ruby
|
776
845
|
@client.create_payment_card(params) # Input:
|
@@ -780,13 +849,13 @@ language.destroy
|
|
780
849
|
### exp_month (integer, required) - card expiration month (1 - 12)
|
781
850
|
### exp_year (integer, required) - card expiration year (for example, 2019)
|
782
851
|
# Output:
|
783
|
-
## A newly created payment card
|
852
|
+
## A newly created payment card
|
784
853
|
|
785
854
|
```
|
786
855
|
|
787
856
|
#### Delete a payment card
|
788
857
|
|
789
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-card-delete)
|
858
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-card-delete)
|
790
859
|
|
791
860
|
```ruby
|
792
861
|
@client.destroy_payment_card(card_id) # Input:
|
@@ -804,11 +873,11 @@ card.destroy
|
|
804
873
|
|
805
874
|
### Projects
|
806
875
|
|
807
|
-
[Project attributes](https://lokalise.com/api2docs/curl/#object-projects)
|
876
|
+
[Project attributes](https://app.lokalise.com/api2docs/curl/#object-projects)
|
808
877
|
|
809
878
|
#### Fetch projects collection
|
810
879
|
|
811
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-projects-get)
|
880
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-projects-get)
|
812
881
|
|
813
882
|
```ruby
|
814
883
|
@client.projects(params = {}) # Input:
|
@@ -816,38 +885,38 @@ card.destroy
|
|
816
885
|
### :filter_team_id (string) - load projects only for the given team
|
817
886
|
### :page and :limit
|
818
887
|
# Output:
|
819
|
-
## Collection of projects under the `projects` attribute
|
888
|
+
## Collection of projects under the `projects` attribute
|
820
889
|
```
|
821
890
|
|
822
891
|
#### Fetch a single project
|
823
892
|
|
824
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-project-get)
|
893
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-project-get)
|
825
894
|
|
826
895
|
```ruby
|
827
896
|
@client.project(project_id) # Input:
|
828
897
|
## project_id (string, required)
|
829
898
|
# Output:
|
830
|
-
## A single project
|
899
|
+
## A single project
|
831
900
|
```
|
832
901
|
|
833
902
|
#### Create a project
|
834
903
|
|
835
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-project-post)
|
904
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-a-project-post)
|
836
905
|
|
837
906
|
```ruby
|
838
907
|
@client.create_project(params) # Input:
|
839
908
|
## params (hash, required)
|
840
909
|
### name (string, required)
|
841
910
|
### description (string)
|
842
|
-
### team_id (integer) - you must be an admin of the chosen team. When omitted, defaults to the current team of the token's owner
|
911
|
+
### team_id (integer) - you must be an admin of the chosen team. When omitted, defaults to the current team of the token's owner
|
843
912
|
# Output:
|
844
|
-
## A newly created project
|
913
|
+
## A newly created project
|
845
914
|
|
846
915
|
```
|
847
916
|
|
848
917
|
#### Update a project
|
849
918
|
|
850
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-project-put)
|
919
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-project-put)
|
851
920
|
|
852
921
|
```ruby
|
853
922
|
@client.update_project(project_id, params) # Input:
|
@@ -868,7 +937,7 @@ project.update(params)
|
|
868
937
|
|
869
938
|
#### Empty a project
|
870
939
|
|
871
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-empty-a-project-put)
|
940
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-empty-a-project-put)
|
872
941
|
|
873
942
|
Deletes *all* keys and translations from the project.
|
874
943
|
|
@@ -888,7 +957,7 @@ project.empty
|
|
888
957
|
|
889
958
|
#### Delete a project
|
890
959
|
|
891
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-project-delete)
|
960
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-project-delete)
|
892
961
|
|
893
962
|
```ruby
|
894
963
|
@client.destroy_project(project_id) # Input:
|
@@ -904,13 +973,40 @@ project = @client.project('project_id')
|
|
904
973
|
project.destroy
|
905
974
|
```
|
906
975
|
|
976
|
+
### Queued processes
|
977
|
+
|
978
|
+
[Queued processes attributes](https://app.lokalise.com/api2docs/curl/#object-queued-processes)
|
979
|
+
|
980
|
+
#### Fetch queued processes
|
981
|
+
|
982
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-processes-get)
|
983
|
+
|
984
|
+
```ruby
|
985
|
+
@client.queued_processes(project_id) # Input:
|
986
|
+
## project_id (string, required)
|
987
|
+
# Output:
|
988
|
+
## Collection of queued processes
|
989
|
+
```
|
990
|
+
|
991
|
+
#### Fetch a single queued process
|
992
|
+
|
993
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-process-get)
|
994
|
+
|
995
|
+
```ruby
|
996
|
+
@client.queued_process(project_id, process_id) # Input:
|
997
|
+
## project_id (string, required)
|
998
|
+
## process_id (string, required)
|
999
|
+
# Output:
|
1000
|
+
## Queued process resource
|
1001
|
+
```
|
1002
|
+
|
907
1003
|
### Screenshots
|
908
1004
|
|
909
|
-
[Screenshot attributes](https://lokalise.com/api2docs/curl/#resource-screenshots)
|
1005
|
+
[Screenshot attributes](https://app.lokalise.com/api2docs/curl/#resource-screenshots)
|
910
1006
|
|
911
1007
|
#### Fetch screenshots
|
912
1008
|
|
913
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-screenshots-get)
|
1009
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-screenshots-get)
|
914
1010
|
|
915
1011
|
```ruby
|
916
1012
|
@client.screenshots(project_id, params = {}) # Input:
|
@@ -923,47 +1019,47 @@ project.destroy
|
|
923
1019
|
|
924
1020
|
#### Fetch a single screenshot
|
925
1021
|
|
926
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-screenshot-get)
|
1022
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-screenshot-get)
|
927
1023
|
|
928
1024
|
```ruby
|
929
1025
|
@client.screeshot(project_id, screeshot_id) # Input:
|
930
1026
|
## project_id (string, required)
|
931
1027
|
## screeshot_id (string, required)
|
932
1028
|
# Output:
|
933
|
-
## A single screenshot
|
1029
|
+
## A single screenshot
|
934
1030
|
```
|
935
1031
|
|
936
1032
|
#### Create screenshots
|
937
1033
|
|
938
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-screenshots-post)
|
1034
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-screenshots-post)
|
939
1035
|
|
940
1036
|
```ruby
|
941
1037
|
@client.create_screenshots(project_id, params) # Input:
|
942
1038
|
## project_id (string, required)
|
943
1039
|
## params (hash or array of hashes, required)
|
944
1040
|
### :data (string, required) - the actual screenshot, base64-encoded (with leading image type "data:image/jpeg;base64,"). JPG and PNG formats are supported.
|
945
|
-
### :title (string)
|
1041
|
+
### :title (string)
|
946
1042
|
### :description (string)
|
947
1043
|
### :ocr (boolean) - recognize translations on the image and attach screenshot to all possible keys
|
948
1044
|
### :key_ids (array) - attach the screenshot to key IDs specified
|
949
|
-
### :tags (array)
|
1045
|
+
### :tags (array)
|
950
1046
|
# Output:
|
951
1047
|
## Collection of created screenshots
|
952
1048
|
```
|
953
1049
|
|
954
1050
|
#### Update screenshot
|
955
1051
|
|
956
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-screenshot-put)
|
1052
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-screenshot-put)
|
957
1053
|
|
958
1054
|
```ruby
|
959
1055
|
@client.update_screenshot(project_id, screenshot_id, params = {}) # Input:
|
960
1056
|
## project_id (string, required)
|
961
1057
|
## screenshot_id (string, required)
|
962
1058
|
## params (hash)
|
963
|
-
### :title (string)
|
1059
|
+
### :title (string)
|
964
1060
|
### :description (string)
|
965
1061
|
### :key_ids (array) - attach the screenshot to key IDs specified
|
966
|
-
### :tags (array)
|
1062
|
+
### :tags (array)
|
967
1063
|
# Output:
|
968
1064
|
## Updated screenshot
|
969
1065
|
```
|
@@ -977,7 +1073,7 @@ screenshot.update(params)
|
|
977
1073
|
|
978
1074
|
#### Delete screenshot
|
979
1075
|
|
980
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-screenshot-delete)
|
1076
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-screenshot-delete)
|
981
1077
|
|
982
1078
|
```ruby
|
983
1079
|
@client.destroy_screenshot(project_id, screenshot_id) # Input:
|
@@ -996,17 +1092,17 @@ screenshot.destroy
|
|
996
1092
|
|
997
1093
|
### Snapshots
|
998
1094
|
|
999
|
-
[Snapshot attributes](https://lokalise.com/api2docs/curl/#object-snapshots)
|
1095
|
+
[Snapshot attributes](https://app.lokalise.com/api2docs/curl/#object-snapshots)
|
1000
1096
|
|
1001
1097
|
#### Fetch snapshots
|
1002
1098
|
|
1003
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-snapshots-get)
|
1099
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-snapshots-get)
|
1004
1100
|
|
1005
1101
|
```ruby
|
1006
1102
|
@client.snapshots(project_id, params = {}) # Input:
|
1007
1103
|
## project_id (string, required)
|
1008
1104
|
## params (hash)
|
1009
|
-
### :filter_title (string) - set title filter for the list
|
1105
|
+
### :filter_title (string) - set title filter for the list
|
1010
1106
|
### :page and :limit
|
1011
1107
|
# Output:
|
1012
1108
|
## Collection of project snapshots
|
@@ -1014,7 +1110,7 @@ screenshot.destroy
|
|
1014
1110
|
|
1015
1111
|
#### Create snapshot
|
1016
1112
|
|
1017
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-snapshot-post)
|
1113
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-a-snapshot-post)
|
1018
1114
|
|
1019
1115
|
```ruby
|
1020
1116
|
@client.create_snapshot(project_id, params = {}) # Input:
|
@@ -1027,7 +1123,7 @@ screenshot.destroy
|
|
1027
1123
|
|
1028
1124
|
#### Restore snapshot
|
1029
1125
|
|
1030
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-restore-a-snapshot-post)
|
1126
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-restore-a-snapshot-post)
|
1031
1127
|
|
1032
1128
|
```ruby
|
1033
1129
|
@client.restore_snapshot(project_id, snapshot_id) # Input:
|
@@ -1046,7 +1142,7 @@ snapshot.restore
|
|
1046
1142
|
|
1047
1143
|
#### Delete snapshot
|
1048
1144
|
|
1049
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-snapshot-delete)
|
1145
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-snapshot-delete)
|
1050
1146
|
|
1051
1147
|
```ruby
|
1052
1148
|
@client.destroy_snapshot(project_id, snapshot_id) # Input:
|
@@ -1065,17 +1161,17 @@ snapshot.destroy
|
|
1065
1161
|
|
1066
1162
|
### Tasks
|
1067
1163
|
|
1068
|
-
[Task attributes](https://lokalise.com/api2docs/curl/#resource-tasks)
|
1164
|
+
[Task attributes](https://app.lokalise.com/api2docs/curl/#resource-tasks)
|
1069
1165
|
|
1070
1166
|
#### Fetch tasks
|
1071
1167
|
|
1072
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-tasks-get)
|
1168
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-tasks-get)
|
1073
1169
|
|
1074
1170
|
```ruby
|
1075
1171
|
@client.tasks(project_id, params = {}) # Input:
|
1076
1172
|
## project_id (string, required)
|
1077
1173
|
## params (hash)
|
1078
|
-
### :filter_title (string) - set title filter for the list
|
1174
|
+
### :filter_title (string) - set title filter for the list
|
1079
1175
|
### :page and :limit
|
1080
1176
|
# Output:
|
1081
1177
|
## Collection of tasks for the project
|
@@ -1083,7 +1179,7 @@ snapshot.destroy
|
|
1083
1179
|
|
1084
1180
|
#### Fetch a single task
|
1085
1181
|
|
1086
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-task-get)
|
1182
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-task-get)
|
1087
1183
|
|
1088
1184
|
```ruby
|
1089
1185
|
@client.task(project_id, task_id, params = {}) # Input:
|
@@ -1095,35 +1191,35 @@ snapshot.destroy
|
|
1095
1191
|
|
1096
1192
|
#### Create task
|
1097
1193
|
|
1098
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-task-post)
|
1194
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-a-task-post)
|
1099
1195
|
|
1100
1196
|
```ruby
|
1101
1197
|
@client.create_task(project_id, params) # Input:
|
1102
1198
|
## project_id (string, required)
|
1103
1199
|
## params (hash, required)
|
1104
1200
|
### title (string, required)
|
1105
|
-
### keys (array) - translation key ids. Required if "parent_task_id" is not specified
|
1201
|
+
### keys (array) - translation key ids. Required if "parent_task_id" is not specified
|
1106
1202
|
### languages (array of hashes, required)
|
1107
1203
|
#### language_iso (string)
|
1108
|
-
#### users (array) - list of users identifiers, assigned to work on the language
|
1109
|
-
### Find other supported options at https://lokalise.com/api2docs/curl/#transition-create-a-task-post
|
1204
|
+
#### users (array) - list of users identifiers, assigned to work on the language
|
1205
|
+
### Find other supported options at https://app.lokalise.com/api2docs/curl/#transition-create-a-task-post
|
1110
1206
|
# Output:
|
1111
|
-
## A newly created task
|
1207
|
+
## A newly created task
|
1112
1208
|
|
1113
1209
|
```
|
1114
1210
|
|
1115
1211
|
#### Update task
|
1116
1212
|
|
1117
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-task-put)
|
1213
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-task-put)
|
1118
1214
|
|
1119
1215
|
```ruby
|
1120
1216
|
@client.update_task(project_id, task_id, params = {}) # Input:
|
1121
1217
|
## project_id (string, required)
|
1122
|
-
## task_id (string or integer, required)
|
1218
|
+
## task_id (string or integer, required)
|
1123
1219
|
## params (hash)
|
1124
|
-
### Find supported params at https://lokalise.com/api2docs/curl/#transition-update-a-task-put
|
1220
|
+
### Find supported params at https://app.lokalise.com/api2docs/curl/#transition-update-a-task-put
|
1125
1221
|
# Output:
|
1126
|
-
## An updated task
|
1222
|
+
## An updated task
|
1127
1223
|
|
1128
1224
|
```
|
1129
1225
|
|
@@ -1136,12 +1232,12 @@ task.update(params)
|
|
1136
1232
|
|
1137
1233
|
#### Delete task
|
1138
1234
|
|
1139
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-task-delete)
|
1235
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-task-delete)
|
1140
1236
|
|
1141
1237
|
```ruby
|
1142
1238
|
@client.destroy_task(project_id, task_id) # Input:
|
1143
1239
|
## project_id (string, required)
|
1144
|
-
## task_id (string, required)
|
1240
|
+
## task_id (string, required)
|
1145
1241
|
# Output:
|
1146
1242
|
## Hash with the project id and "task_deleted" set to "true"
|
1147
1243
|
|
@@ -1158,7 +1254,7 @@ task.destroy
|
|
1158
1254
|
|
1159
1255
|
#### Fetch teams
|
1160
1256
|
|
1161
|
-
[Doc](https://lokalise.com/api2docs/curl/#resource-teams)
|
1257
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#resource-teams)
|
1162
1258
|
|
1163
1259
|
```ruby
|
1164
1260
|
@client.teams(params = {}) # Input:
|
@@ -1170,11 +1266,11 @@ task.destroy
|
|
1170
1266
|
|
1171
1267
|
### Team users
|
1172
1268
|
|
1173
|
-
[Team user attributes](https://lokalise.com/api2docs/curl/#object-team-users)
|
1269
|
+
[Team user attributes](https://app.lokalise.com/api2docs/curl/#object-team-users)
|
1174
1270
|
|
1175
1271
|
#### Fetch team users
|
1176
1272
|
|
1177
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-team-users-get)
|
1273
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-team-users-get)
|
1178
1274
|
|
1179
1275
|
```ruby
|
1180
1276
|
@client.team_users(team_id, params = {}) # Input:
|
@@ -1187,7 +1283,7 @@ task.destroy
|
|
1187
1283
|
|
1188
1284
|
#### Fetch a single team user
|
1189
1285
|
|
1190
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-team-user-get)
|
1286
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-team-user-get)
|
1191
1287
|
|
1192
1288
|
```ruby
|
1193
1289
|
@client.team_user(team_id, user_id) # Input:
|
@@ -1199,14 +1295,14 @@ task.destroy
|
|
1199
1295
|
|
1200
1296
|
#### Update team user
|
1201
1297
|
|
1202
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-team-user-put)
|
1298
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-team-user-put)
|
1203
1299
|
|
1204
1300
|
```ruby
|
1205
1301
|
@client.update_team_user(team_id, user_id, params) # Input:
|
1206
1302
|
## team_id (string, required)
|
1207
1303
|
## user_id (string, required)
|
1208
1304
|
## params (hash, required):
|
1209
|
-
### :role (string, required) - :owner, :admin, or :member
|
1305
|
+
### :role (string, required) - :owner, :admin, or :member
|
1210
1306
|
# Output:
|
1211
1307
|
## Updated team user
|
1212
1308
|
```
|
@@ -1220,7 +1316,7 @@ user.update(params)
|
|
1220
1316
|
|
1221
1317
|
#### Delete team user
|
1222
1318
|
|
1223
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-team-user-delete)
|
1319
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-team-user-delete)
|
1224
1320
|
|
1225
1321
|
```ruby
|
1226
1322
|
@client.destroy_team_user(team_id, user_id) # Input:
|
@@ -1239,11 +1335,11 @@ user.destroy
|
|
1239
1335
|
|
1240
1336
|
### Team user groups
|
1241
1337
|
|
1242
|
-
[Team user group attributes](https://lokalise.com/api2docs/curl/#object-team-user-groups)
|
1338
|
+
[Team user group attributes](https://app.lokalise.com/api2docs/curl/#object-team-user-groups)
|
1243
1339
|
|
1244
1340
|
#### Fetch team user groups
|
1245
1341
|
|
1246
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-groups-get)
|
1342
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-groups-get)
|
1247
1343
|
|
1248
1344
|
```ruby
|
1249
1345
|
@client.team_user_groups(team_id, params = {}) # Input:
|
@@ -1256,7 +1352,7 @@ user.destroy
|
|
1256
1352
|
|
1257
1353
|
#### Fetch a single group
|
1258
1354
|
|
1259
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-group-get)
|
1355
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-group-get)
|
1260
1356
|
|
1261
1357
|
```ruby
|
1262
1358
|
@client.team_user_group(team_id, group_id) # Input:
|
@@ -1268,7 +1364,7 @@ user.destroy
|
|
1268
1364
|
|
1269
1365
|
#### Create group
|
1270
1366
|
|
1271
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-group-post)
|
1367
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-a-group-post)
|
1272
1368
|
|
1273
1369
|
```ruby
|
1274
1370
|
@client.create_team_user_group(team_id, params) # Input:
|
@@ -1285,7 +1381,7 @@ user.destroy
|
|
1285
1381
|
|
1286
1382
|
#### Update group
|
1287
1383
|
|
1288
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-group-put)
|
1384
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-group-put)
|
1289
1385
|
|
1290
1386
|
```ruby
|
1291
1387
|
@client.update_team_user_group(team_id, group_id, params) # Input:
|
@@ -1310,7 +1406,7 @@ group.update(params)
|
|
1310
1406
|
|
1311
1407
|
#### Add projects to group
|
1312
1408
|
|
1313
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-add-projects-to-group-put)
|
1409
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-add-projects-to-group-put)
|
1314
1410
|
|
1315
1411
|
```ruby
|
1316
1412
|
@client.add_projects_to_group(team_id, group_id, project_ids) # Input:
|
@@ -1328,7 +1424,7 @@ group.add_projects projects: [project_id1, project_id2]
|
|
1328
1424
|
|
1329
1425
|
#### Remove projects from group
|
1330
1426
|
|
1331
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-remove-projects-from-group-put)
|
1427
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-remove-projects-from-group-put)
|
1332
1428
|
|
1333
1429
|
```ruby
|
1334
1430
|
@client.remove_projects_from_group(team_id, group_id, project_ids) # Input:
|
@@ -1346,7 +1442,7 @@ group.remove_projects projects: [project_id1, project_id2]
|
|
1346
1442
|
|
1347
1443
|
#### Add users (members) to group
|
1348
1444
|
|
1349
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-add-members-to-group-put)
|
1445
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-add-members-to-group-put)
|
1350
1446
|
|
1351
1447
|
```ruby
|
1352
1448
|
@client.add_users_to_group(team_id, group_id, user_ids) # Input:
|
@@ -1364,7 +1460,7 @@ group.add_users users: [user_id1, user_id2]
|
|
1364
1460
|
|
1365
1461
|
#### Remove users (members) from group
|
1366
1462
|
|
1367
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-remove-members-from-group-put)
|
1463
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-remove-members-from-group-put)
|
1368
1464
|
|
1369
1465
|
```ruby
|
1370
1466
|
@client.remove_users_from_group(team_id, group_id, user_ids) # Input:
|
@@ -1382,7 +1478,7 @@ group.remove_users users: [user_id1, user_id2]
|
|
1382
1478
|
|
1383
1479
|
#### Destroy group
|
1384
1480
|
|
1385
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-group-delete)
|
1481
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-group-delete)
|
1386
1482
|
|
1387
1483
|
```ruby
|
1388
1484
|
@client.destroy_team_user_group(team_id, group_id) # Input:
|
@@ -1401,11 +1497,11 @@ group.destroy
|
|
1401
1497
|
|
1402
1498
|
### Translations
|
1403
1499
|
|
1404
|
-
[Translation attributes](https://lokalise.com/api2docs/curl/#resource-translations)
|
1500
|
+
[Translation attributes](https://app.lokalise.com/api2docs/curl/#resource-translations)
|
1405
1501
|
|
1406
1502
|
#### Fetch translations
|
1407
1503
|
|
1408
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-translations-get)
|
1504
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-translations-get)
|
1409
1505
|
|
1410
1506
|
```ruby
|
1411
1507
|
@client.translations(project_id, params = {}) # Input:
|
@@ -1419,12 +1515,12 @@ group.destroy
|
|
1419
1515
|
|
1420
1516
|
#### Fetch a single translation
|
1421
1517
|
|
1422
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-translation-get)
|
1518
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-translation-get)
|
1423
1519
|
|
1424
1520
|
```ruby
|
1425
1521
|
@client.translation(project_id, translation_id, params = {}) # Input:
|
1426
1522
|
## project_id (string, required)
|
1427
|
-
## translation_id (string, required)
|
1523
|
+
## translation_id (string, required)
|
1428
1524
|
## params (hash)
|
1429
1525
|
### :disable_references (string) - whether to disable key references. Supported values are 0 and 1
|
1430
1526
|
# Output:
|
@@ -1433,16 +1529,16 @@ group.destroy
|
|
1433
1529
|
|
1434
1530
|
#### Update translation
|
1435
1531
|
|
1436
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-translation-put)
|
1532
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-translation-put)
|
1437
1533
|
|
1438
1534
|
```ruby
|
1439
1535
|
@client.update_translation(project_id, translation_id, params = {}) # Input:
|
1440
1536
|
## project_id (string, required)
|
1441
|
-
## translation_id (string, required)
|
1537
|
+
## translation_id (string, required)
|
1442
1538
|
## params (hash, required)
|
1443
1539
|
### :translation (string or hash, required) - the actual translation. Provide hash for plural keys.
|
1444
1540
|
### :is_fuzzy (boolean)
|
1445
|
-
### :is_reviewed (boolean)
|
1541
|
+
### :is_reviewed (boolean)
|
1446
1542
|
# Output:
|
1447
1543
|
## Updated translation
|
1448
1544
|
```
|
@@ -1456,11 +1552,11 @@ translation.update(params)
|
|
1456
1552
|
|
1457
1553
|
### Translation Providers
|
1458
1554
|
|
1459
|
-
[Translation provider attributes](https://lokalise.com/api2docs/curl/#object-translation-providers)
|
1555
|
+
[Translation provider attributes](https://app.lokalise.com/api2docs/curl/#object-translation-providers)
|
1460
1556
|
|
1461
1557
|
#### Fetch translation providers
|
1462
1558
|
|
1463
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-providers-get)
|
1559
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-providers-get)
|
1464
1560
|
|
1465
1561
|
```ruby
|
1466
1562
|
@client.translation_providers(team_id, params = {}) # Input:
|
@@ -1473,25 +1569,25 @@ translation.update(params)
|
|
1473
1569
|
|
1474
1570
|
#### Fetch a single translation provider
|
1475
1571
|
|
1476
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-provider-get)
|
1572
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-provider-get)
|
1477
1573
|
|
1478
1574
|
```ruby
|
1479
1575
|
@client.translation_provider(team_id, provider_id) # Input:
|
1480
1576
|
## team_id (string, required)
|
1481
|
-
## provider_id (string, required)
|
1577
|
+
## provider_id (string, required)
|
1482
1578
|
# Output:
|
1483
1579
|
## Single provider for the team
|
1484
1580
|
```
|
1485
1581
|
|
1486
1582
|
### Translation Statuses
|
1487
1583
|
|
1488
|
-
[Translation Status attributes](https://lokalise.com/api2docs/curl/#object-translation-statuses)
|
1584
|
+
[Translation Status attributes](https://app.lokalise.com/api2docs/curl/#object-translation-statuses)
|
1489
1585
|
|
1490
1586
|
*Custom translation statuses must be enabled for the project before using this endpoint!* It can be done in the project settings.
|
1491
1587
|
|
1492
1588
|
#### Fetch translation statuses
|
1493
1589
|
|
1494
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-custom-translation-statuses-get)
|
1590
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-custom-translation-statuses-get)
|
1495
1591
|
|
1496
1592
|
```ruby
|
1497
1593
|
@client.translation_statuses(project_id, params = {}) # Input:
|
@@ -1504,7 +1600,7 @@ translation.update(params)
|
|
1504
1600
|
|
1505
1601
|
#### Fetch a single translation status
|
1506
1602
|
|
1507
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-custom-translation-status-get)
|
1603
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-custom-translation-status-get)
|
1508
1604
|
|
1509
1605
|
```ruby
|
1510
1606
|
@client.translation_status(project_id, status_id) # Input:
|
@@ -1516,7 +1612,7 @@ translation.update(params)
|
|
1516
1612
|
|
1517
1613
|
#### Create translation status
|
1518
1614
|
|
1519
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-custom-translation-status-post)
|
1615
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-a-custom-translation-status-post)
|
1520
1616
|
|
1521
1617
|
```ruby
|
1522
1618
|
@client.create_translation_status(project_id, params) # Input:
|
@@ -1530,7 +1626,7 @@ translation.update(params)
|
|
1530
1626
|
|
1531
1627
|
#### Update translation status
|
1532
1628
|
|
1533
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-custom-translation-status-put)
|
1629
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-custom-translation-status-put)
|
1534
1630
|
|
1535
1631
|
```ruby
|
1536
1632
|
@client.update_translation_status(project_id, status_id, params) # Input:
|
@@ -1552,7 +1648,7 @@ status.update(params)
|
|
1552
1648
|
|
1553
1649
|
#### Delete translation status
|
1554
1650
|
|
1555
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-custom-translation-status-delete)
|
1651
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-custom-translation-status-delete)
|
1556
1652
|
|
1557
1653
|
```ruby
|
1558
1654
|
@client.destroy_translation_status(project_id, status_id) # Input:
|
@@ -1571,7 +1667,7 @@ status.destroy
|
|
1571
1667
|
|
1572
1668
|
#### Supported color codes for translation statuses
|
1573
1669
|
|
1574
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-available-colors-for-custom-translation-statuses-get)
|
1670
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-available-colors-for-custom-translation-statuses-get)
|
1575
1671
|
|
1576
1672
|
As long as Lokalise supports only very limited array of color hexadecimal codes for custom translation statuses, this method can be used to fetch all permitted values.
|
1577
1673
|
|
@@ -1584,11 +1680,11 @@ As long as Lokalise supports only very limited array of color hexadecimal codes
|
|
1584
1680
|
|
1585
1681
|
### Webhooks
|
1586
1682
|
|
1587
|
-
[Webhook attributes](https://lokalise.com/api2docs/curl/#object-webhooks)
|
1683
|
+
[Webhook attributes](https://app.lokalise.com/api2docs/curl/#object-webhooks)
|
1588
1684
|
|
1589
1685
|
#### Fetch webhooks
|
1590
1686
|
|
1591
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-list-all-webhooks-get)
|
1687
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-list-all-webhooks-get)
|
1592
1688
|
|
1593
1689
|
```ruby
|
1594
1690
|
@client.webhooks(project_id, params = {}) # Input:
|
@@ -1601,19 +1697,19 @@ As long as Lokalise supports only very limited array of color hexadecimal codes
|
|
1601
1697
|
|
1602
1698
|
#### Fetch a single webhook
|
1603
1699
|
|
1604
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-retrieve-a-webhook-get)
|
1700
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-retrieve-a-webhook-get)
|
1605
1701
|
|
1606
1702
|
```ruby
|
1607
1703
|
@client.webhook(project_id, webhook_id) # Input:
|
1608
1704
|
## project_id (string, required)
|
1609
|
-
## webhook_id (string
|
1705
|
+
## webhook_id (string, required)
|
1610
1706
|
# Output:
|
1611
1707
|
## Webhook for the given project
|
1612
1708
|
```
|
1613
1709
|
|
1614
1710
|
#### Create webhook
|
1615
1711
|
|
1616
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-create-a-webhook-post)
|
1712
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-create-a-webhook-post)
|
1617
1713
|
|
1618
1714
|
```ruby
|
1619
1715
|
@client.create_webhook(project_id, params) # Input:
|
@@ -1628,12 +1724,12 @@ As long as Lokalise supports only very limited array of color hexadecimal codes
|
|
1628
1724
|
|
1629
1725
|
#### Update webhook
|
1630
1726
|
|
1631
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-update-a-webhook-put)
|
1727
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-update-a-webhook-put)
|
1632
1728
|
|
1633
1729
|
```ruby
|
1634
1730
|
@client.update_webhook(project_id, webhook_id, params) # Input:
|
1635
1731
|
## project_id (string, required)
|
1636
|
-
## webhook_id (string
|
1732
|
+
## webhook_id (string, required)
|
1637
1733
|
## params (hash)
|
1638
1734
|
### :url (string) - webhook URL
|
1639
1735
|
### :events (array) - events to subscribe to. Check the API docs to find the list of supported events
|
@@ -1651,12 +1747,12 @@ webhook.update(params)
|
|
1651
1747
|
|
1652
1748
|
#### Delete webhook
|
1653
1749
|
|
1654
|
-
[Doc](https://lokalise.com/api2docs/curl/#transition-delete-a-webhook-delete)
|
1750
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-delete-a-webhook-delete)
|
1655
1751
|
|
1656
1752
|
```ruby
|
1657
1753
|
@client.destroy_webhook(project_id, webhook_id) # Input:
|
1658
1754
|
## project_id (string, required)
|
1659
|
-
## webhook_id (string
|
1755
|
+
## webhook_id (string, required)
|
1660
1756
|
# Output:
|
1661
1757
|
## Result of the delete operation
|
1662
1758
|
```
|
@@ -1668,6 +1764,25 @@ webhook = @client.webhook(project_id, webhook_id)
|
|
1668
1764
|
webhook.destroy
|
1669
1765
|
```
|
1670
1766
|
|
1767
|
+
#### Regenerate webhook secret
|
1768
|
+
|
1769
|
+
[Doc](https://app.lokalise.com/api2docs/curl/#transition-regenerate-a-webhook-secret-patch)
|
1770
|
+
|
1771
|
+
```ruby
|
1772
|
+
@client.regenerate_webhook_secret(project_id, webhook_id) # Input:
|
1773
|
+
## project_id (string, required)
|
1774
|
+
## webhook_id (string, required)
|
1775
|
+
# Output:
|
1776
|
+
## Hash containing `project_id` and new `secret`
|
1777
|
+
```
|
1778
|
+
|
1779
|
+
Alternatively:
|
1780
|
+
|
1781
|
+
```ruby
|
1782
|
+
webhook = @client.webhook(project_id, webhook_id)
|
1783
|
+
webhook.regenerate_secret
|
1784
|
+
```
|
1785
|
+
|
1671
1786
|
## Additional Info
|
1672
1787
|
|
1673
1788
|
### Customizing Request
|
@@ -1715,7 +1830,7 @@ For example, to use [Oj](https://github.com/ohler55/oj) you would do the followi
|
|
1715
1830
|
require 'oj'
|
1716
1831
|
|
1717
1832
|
module Lokalise
|
1718
|
-
module JsonHandler
|
1833
|
+
module JsonHandler
|
1719
1834
|
# This method accepts a Ruby object and must return a JSON string
|
1720
1835
|
def custom_dump(obj)
|
1721
1836
|
Oj.dump obj
|
@@ -1731,7 +1846,7 @@ end
|
|
1731
1846
|
|
1732
1847
|
### Error handling
|
1733
1848
|
|
1734
|
-
[Error codes](https://lokalise.com/api2docs/curl/#resource-errors)
|
1849
|
+
[Error codes](https://app.lokalise.com/api2docs/curl/#resource-errors)
|
1735
1850
|
|
1736
1851
|
The gem may raise the following custom exceptions:
|
1737
1852
|
|
@@ -1751,7 +1866,7 @@ The gem may raise the following custom exceptions:
|
|
1751
1866
|
|
1752
1867
|
### API Rate Limits
|
1753
1868
|
|
1754
|
-
Lokalise does not [rate-limit API requests](https://lokalise.com/api2docs/curl/#resource-rate-limits), however retain a right to decline the service in case of excessive use. Only one concurrent request per token is allowed. To ensure data consistency, it is not recommended to access the same project simultaneously using multiple tokens.
|
1869
|
+
Lokalise does not [rate-limit API requests](https://app.lokalise.com/api2docs/curl/#resource-rate-limits), however retain a right to decline the service in case of excessive use. Only one concurrent request per token is allowed. To ensure data consistency, it is not recommended to access the same project simultaneously using multiple tokens.
|
1755
1870
|
|
1756
1871
|
## Running Tests
|
1757
1872
|
|