0.0
No release in over 3 years
Low commit activity in last 3 years
Translates locale files
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.8.1
~> 2.0.3
~> 0.1.1
>= 0
 Project Readme

Translator Gem

This gem is for pushing and pulling translations to and from Smartling.

Installation

Add this line to your application's Gemfile:

# Gemfile
source "https://rubygems.org"
gem 'mc_translator', '~> 0.1.3'

And then execute:

$ bundle install

Then, in your Rakefile:

# Rakefile
require 'mc_translator'

Once you've got it installed, you'll need some basic configuration by setting up some ENV vars and adding a .translations.yml:

# .env.development
SMARTLING_USER_ID: xxxxxxxxxxxxxxxxxx
SMARTLING_USER_SECRET: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SMARTLING_PROJECT_ID: xxxxxxx
# .translations.yml
locales:
  - en-GB
matches:
  - pattern: '**/*en-US.yml'
    type: YAML
  - pattern: '**/*en-US.json'
    type: JSON
parentBranch: master

Usage

To keep things as simple as possible, we've added some Rake commands so that you can do this as simply as running:

# Push only changed files (git) to Smartling
$ rake translator:push

# Push all files that match to Smartling
$ rake translator:push:all

and

# Pull translated files related to a Smartling job with the same name as your branch
$ rake translator:pull

# Pull all translated files in Smartling project that match config
$ rake translator:pull:all