mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Added Moment i18n support
This commit is contained in:
parent
2e3234fc58
commit
41729f9700
1 changed files with 8 additions and 1 deletions
|
@ -31,6 +31,7 @@ init = ->
|
|||
app.initialize()
|
||||
Backbone.history.start({ pushState: true })
|
||||
handleNormalUrls()
|
||||
setUpMoment() # Set up i18n for moment
|
||||
|
||||
treemaExt = require 'treema-ext'
|
||||
treemaExt.setup()
|
||||
|
@ -64,6 +65,12 @@ setUpDefinitions = ->
|
|||
for definition of definitionSchemas
|
||||
Backbone.Mediator.addDefSchemas definitionSchemas[definition]
|
||||
|
||||
setUpMoment = ->
|
||||
{me} = require 'lib/auth'
|
||||
moment.lang me.lang(), {}
|
||||
me.on 'change', (me) ->
|
||||
moment.lang me.lang(), {} if me._previousAttributes.preferredLanguage isnt me.get 'preferredLanguage'
|
||||
|
||||
initializeServices = ->
|
||||
services = [
|
||||
'./lib/services/filepicker'
|
||||
|
@ -92,4 +99,4 @@ watchForErrors = ->
|
|||
#msg += "\nStack: #{stack}" if stack = error?.stack
|
||||
noty text: msg, layout: 'topCenter', type: 'error', killer: false, timeout: 5000, dismissQueue: true, maxVisible: 3, callback: {onClose: -> --currentErrors}
|
||||
|
||||
$ -> init()
|
||||
$ -> init()
|
||||
|
|
Loading…
Reference in a new issue