Ruby

Exchange translation files between your Ruby app and Lokalise.

Ilya Krukowski avatar
Written by Ilya Krukowski
Updated over a week ago

Please note that this article covers a solution for plain Ruby. You might also be interested in our Ruby on Rails integration.

Prerequisites

Exchanging translation files

If you are building a plain Ruby application and would like to exchange translation files with Lokalise, you can take advantage of a special library to manage translation files (lokalise_manager gem) which allows to run the import/export task programmatically from any Ruby script.

Here's an example:

require "#{Rails.root}/config/lokalise_rails.rb"

importer = LokaliseManager.importer({api_token: '1234abc', project_id: '123.abc'}, LokaliseRails::GlobalConfig)
importer.import!

# OR

exporter = LokaliseManager.exporter({api_token: '1234abc', project_id: '123.abc'}, LokaliseRails::GlobalConfig)
exporter.export!

Did this answer your question?