Lokalise APIv2 Ruby SDK

Ruby interface for the Lokalise APIv2 that represents returned data as Ruby objects.

View the Project on GitHub lokalise/ruby-lokalise-api




Lokalise APIv2 Ruby interface

Install the gem:

gem install ruby-lokalise-api

Obtain Lokalise API token in your personal profile, initialize and use the client:

require 'ruby_lokalise_api'

@client = RubyLokaliseApi.client 'YOUR_TOKEN_HERE'

project = @client.project '123.abc'
project.name # => 'My Project'

process = @client.upload_file project_id,
                              data: 'Base-64 encoded data... ZnI6DQogI...',
                              filename: 'my_file.yml',
                              lang_iso: 'en'

process.status # => 'queued'

reloaded_process = process.reload_data

reloaded_process.status # => 'completed'

Looking for a Rails integration? Try the lokalise_rails gem. Also you can use a lokalise_manager gem which allows to exchange translation files between Lokalise and any Ruby script.

You can also check this repo containing some usage examples and this blog post with explanations.

Usage

Additional info