<commit_before>== Overview

Rake task which creates translated locales files of a rails project from source locales. 

Translations are 'bulk' translations from google, and might be reviewed but that's a easy first step.

Create your locales files with your own language and run the task with targeted languages.

It uses the gem 'easy_translator' which use google translations api.

== Installation

  gem install i18n_translator

and require the gem in your rails project

  gem 'i18n_translator'

== Usage

  rake i18n:translate['en','fr;es'].

Separate targets languages symbols with semicolons.

<b>/!\ Don't put space after the coma for rake tasks parameters.</b>

With no additional argument, it will translate and create locales for <b>all</b> your source locales.

If you want to just do the work with only one locale source, pass an additional path to file source argument to rake tasks :

  rake i18n:translate['en','fr;es','config/locales/user/en.yml'].

== Convention

The source locale is supposed to be named <lang>.yml where lang is the language symbol (fr, en , es ... and so on)

== Example

- config
 - locales
  - models
   - user
    - en.yml
   - book
    - en.yml
    
Will generate :

- config
 - locales
  - models
   - user
    - en.yml
    - fr.yml
    - es.yml
   - book
    - en.yml
    - fr.yml
    - es.yml
  
== Dependencies

* rake
* easy_translator    

== TO-DOs

Add options to be more flexible ; ie pass a translator lambda to use other translator.

== Issues

Sometimes phrases with interpolations are not double quoted


== Licence

MIT Licence<commit_msg>Update master<commit_after>== Overview

Rake task which creates translated locales files of a rails project from source locales. 

Translations are 'bulk' translations from google, and might be reviewed but that's a easy first step.

Create your locales files with your own language and run the task with targeted languages.

It uses the gem 'easy_translator' which use google translations api.

== Code Quality Metrics

{<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/anoiaque/i18n_translator]

== Installation

  gem install i18n_translator

and require the gem in your rails project

  gem 'i18n_translator'

== Usage

  rake i18n:translate['en','fr;es'].

Separate targets languages symbols with semicolons.

<b>/!\ Don't put space after the coma for rake tasks parameters.</b>

With no additional argument, it will translate and create locales for <b>all</b> your source locales.

If you want to just do the work with only one locale source, pass an additional path to file source argument to rake tasks :

  rake i18n:translate['en','fr;es','config/locales/user/en.yml'].

== Convention

The source locale is supposed to be named <lang>.yml where lang is the language symbol (fr, en , es ... and so on)

== Example

- config
 - locales
  - models
   - user
    - en.yml
   - book
    - en.yml
    
Will generate :

- config
 - locales
  - models
   - user
    - en.yml
    - fr.yml
    - es.yml
   - book
    - en.yml
    - fr.yml
    - es.yml
  
== Dependencies

* rake
* easy_translator    

== TO-DOs

Add options to be more flexible ; ie pass a translator lambda to use other translator.

== Issues

Sometimes phrases with interpolations are not double quoted


== Licence

MIT Licence
{'fraction_non_alphanumeric': 0.08095094793860969, 'fraction_numerical': 0.005416792055371652, 'mean_word_length': 3.181132075471698, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '44273', 'n_tokens_mistral': 1061, 'n_tokens_neox': 981, 'n_words': 418}