Project

babel_diff

0.0
No commit activity in last 3 years
No release in over 3 years
A logger for updates and additions to locale yaml files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.8
>= 0
~> 10.0
 Project Readme

BabelDiff

Installation

Add this line to your application's Gemfile:

gem 'babel_diff'

And then execute:

$ bundle

Or install it yourself as:

$ gem install babel_diff

Usage

BabelDiff.run

Running the above command from the Rails console will create two files, "phrases.en.additions.yml" and "phrases.en.updates.yml", in your locales directory.

These files will contain all added and updated translation keys, respectively. If this is your first time running BabelDiff, the additions file will contain all of your translation keys.

The file "phrases.en.previous_version.yml" will also be created to serve as the benchmark against which future diffs will be compared.

If you want to run BabelDiff on a different locale file, you can pass it to the "#run" method. The default file path is "config/locales/phrases.en.yml".

The following code:

BabelDiff.run("config/locales/random_folder/phrases.fr.yml")

would produce the following files:

Additions => config/locales/random_folder/phrases.additions.fr.yml Updates => config/locales/random_folder/phrases.updates.fr.yml Previous Version => config/locales/random_folder/phrases.previous_version.fr.yml