Ruby interface for the Lokalise APIv2 that represents returned data as Ruby objects.
View the Project on GitHub lokalise/ruby-lokalise-api
@client.screenshots(project_id, params = {}) # Input:
## project_id (string, required)
## params (hash)
### :page and :limit
# Output:
## Collection of project screenshots
For example:
@client.screenshots project_id, limit: 1, page: 1
@client.screeshot(project_id, screeshot_id) # Input:
## project_id (string, required)
## screeshot_id (string, required)
# Output:
## A single screenshot
@client.create_screenshots(project_id, params) # Input:
## project_id (string, required)
## params (hash or array of hashes, required)
### :data (string, required) - the actual screenshot, base64-encoded (with leading image type "data:image/jpeg;base64,"). JPG and PNG formats are supported.
### :title (string)
### :description (string)
### :ocr (boolean) - recognize translations on the image and attach screenshot to all possible keys
### :key_ids (array) - attach the screenshot to key IDs specified
### :tags (array)
# Output:
## Collection of created screenshots
For example:
@client.create_screenshots project_id, data: 'data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAH0AAA...', title: 'My screen'
@client.update_screenshot(project_id, screenshot_id, params = {}) # Input:
## project_id (string, required)
## screenshot_id (string, required)
## params (hash)
### :title (string)
### :description (string)
### :key_ids (array) - attach the screenshot to key IDs specified
### :tags (array)
# Output:
## Updated screenshot
Alternatively:
screenshot = @client.screenshot('project_id', 'screen_id')
screenshot.update(params)
For example:
@client.update_screenshot project_id, screenshot_id,
tags: %w[demo sample],
description: 'Sample screen'
@client.destroy_screenshot(project_id, screenshot_id) # Input:
## project_id (string, required)
## screenshot_id (string, required)
# Output:
## Hash with the project id and "screenshot_deleted" set to "true"
Alternatively:
screenshot = @client.screenshot('project_id', 'screen_id')
screenshot.destroy