change I18n.missingTranslation so that we use the last part of the key, titleized instead of a phat, ugly monster message

This commit is contained in:
Sven Fuchs 2012-11-22 16:24:40 +01:00
parent 174053dfa6
commit be1c52e69a
3 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,5 @@
I18n.missingTranslation = ->
key = arguments[arguments.length - 1]
value = key.split('.').pop()
$.titleize(value)

View File

@ -64,6 +64,10 @@ $.extend
string[0].toLowerCase() + string.substring(1).replace /([A-Z])?/g, (match, chr) ->
if chr then "_#{chr.toUpperCase()}" else ''
titleize: (string) ->
$.capitalize(string).replace /_(.)?/g, (match, chr) ->
if chr then ' ' + chr.toUpperCase() else ''
camelize: (string, uppercase) ->
string = if uppercase == false then $.underscore(string) else $.capitalize(string)
string.replace /_(.)?/g, (match, chr) ->

View File

@ -71,6 +71,7 @@ if window.history.state == undefined
@store = app.store
$ => app.initialize()
require 'ext/i18n'
require 'travis/ajax'
require 'app'