Skip to content

Instantly share code, notes, and snippets.

View mmorrison's full-sized avatar

Marcus Morrison mmorrison

View GitHub Profile
@mmorrison
mmorrison / i18n.coffee
Created November 23, 2012 03:46 — forked from madrobby/i18n.coffee
Backbone i18n with CoffeeScript
# before this file is loaded, a locale should be set:
#
# In a browser environment, you can use:
# ```<script>__locale='en';</script>```
#
# In a server environment (specifically node.js):
# ```global.__locale = 'en';```
# normalize in-app locale string to "en" or "de-AT"
parts = @__locale.split('-')