Polyglot-Sync

A gem to sync translation strings between your Rails backend & the Polyglot API.

Installation

Add this line to your application's Gemfile:

gem 'polyglot-sync'

And then execute:

$ bundle

Or install it yourself as:

$ gem install polyglot-sync

To run the generator:

$ rails g polyglot:install

Or create the polyglot_sync.rb initializer file yourself, containing the following:

Polyglot::Sync.configure do |config|
  config.aws_s3_bucket_name = 'BUCKET NAME'

  config.project_slug = 'PROJECT SLUG'

  config.organization_secret_key = 'SECRET KEY'

  config.aws_cloudfront_host = 'CLOUDFRONT HOST'

  config.aws_region = 'AWS REGION'
end

If you do not know the details of your AWS configuration for the Polyglot API, you will need to contact Gaspard+Bruno directly.

Usage

To download existing project strings from your Polyglot API dashboard, run the following command in your terminal:

$ rake sync:import

To upload the .yml files located in config/locales, run the following command in your terminal:

$ rake sync:export

Be aware that importing or exporting will override alternative strings at the destination.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Gaspard-Bruno/polyglot-sync.

License

The gem is available as open source under the terms of the MIT License.