Skip to main content
Ruby

Exchange translation files between your Ruby app and Lokalise.

Ilya Krukowski avatar
Written by Ilya Krukowski
Updated over 9 months ago

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

Lokalise can be used with Ruby apps.

Prerequisites

Exchanging translation files

Please find more information on all the available options and other features in the official repo.

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?