fnando/i18n-js — pull request #165 by mfo (2013-08-30 09:42:58+00:00)
Title: Add support for JS namespacing

Hi,

I'm working on embeddable scripts. Here is an example :
```html

```

By using I18n as it was, I Could create conflicts with the webpage hosting my embeddable code. Let's imagine a window.I18n already exists, It would just override things and broke stuffs.

So I needed a way to scope it. Here is a proposal: within I18n-js.yml add:
```yamp
js_namespace: myawesomenamespace
```

Then, the vender/assets/javascript/I18n.js plugin will be scoped as (same thing with the translations.js.erb file):
```javascript
var myawesomenamespace = myawesomenamespace || {};
myawesomenamespace.I18n. = myawesomenamespace.I18n || {}
```

Saying that, It's not mergeable in this state. I fought some time with the rake spec:js in order to precompile the I18n.js.erb file, but can't figure how to make it works before runnings the spec. So if you are interested by this pull request, I would love to hear about the spec-js gem to bullet proof your JS tests.

By & great works for this gem