Project

makeloc

0.0
No commit activity in last 3 years
No release in over 3 years
A generator to updates, or creates if not exists, the locale file for the provided target language
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0
~> 3.1
~> 0.2
~> 2.0
~> 3.12
~> 2.8
~> 0.8

Runtime

>= 2.2
 Project Readme

Makeloc

A little generator to tidy locale files along with their content for Ruby On Rails

Idea

Makeloc comes from the necessity to update or create locale files while developing Ruby on Rails application. Often there is a reference language which get manually updated whenever necessary and later all the other locales should follow the same update steps. This last part could be very tedious and prone to errors or missings.

Makeloc, given a reference filepath (formatted as path/to/file/context.reference_lang.yml) and a target language, creates, in the same folder, a corresponding locale file path/to/file/context.target_lang.yml with same keys. If the target file already exists it gets updated. It actually get recreated with the same structure (same keys set) of the reference one and then updated with old values. This means that keys in the old target locale file not present in the reference one will be wiped out after generation.

Installation

gem install makeloc

Usage

Makeloc is a generator. The following will create, or update if it exists, the file config/locales/activerecord.it.yml

rails g makeloc:do it config/locales/activerecord.en.yml [--strict]

with option --strict, in case of update, it deletes any extra keys in the destination locale file

Test

rake spec

Contributing

Comments and feedback are welcome


Copyright (c) 2014 masciugo. See LICENSE.txt for further details.