fnando/i18n-js — pull request #226 by Deradon (2014-06-18 15:18:50+00:00)
Title: Add fallbacks option to i18n-js.yml

### Given the following "i18n-js.yml":

```
fallbacks: true

translations:
- file: "public/javascripts/i18n/%{locale}.js"
only: '*'
```

I want "i18n-JS" to do the following:

> Each generated JS-file should contain all localized strings. So we only need to include one js-file in frontent. This JS-File should contain all localized strings AND any fallback strings if localization is missing yet.

### Possible i18n-js.yml configs

#### Simple

```
fallbacks: true

translations:
- file: "public/javascripts/i18n/%{locale}.js"
only: '*'
```
This will enable merging fallbacks into each file. (set to false to disable)
If you use I18n with fallbacks, the fallbacks defined there will be used.
Otherwise I18n.default_locale will be used.

#### Merge with specific locale

```yaml
fallbacks: :de

translations:
- file: "public/javascripts/i18n/%{locale}.js"
only: '*'
```

#### Merge with specific locale (per Hash)

```yaml
fallbacks:
fr: ["de", "en"]
de: "en"

translations:
- file: "public/javascripts/i18n/%{locale}.js"
only: '*'
```
Fallbacks defined will be used, if not defined (e.g.: :pl) I18n.fallbacks or I18n.default_locale will be used.

* This is a follow up PR from #114
* Implemented it the way @johnnyshields suggested.