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:
parent
174053dfa6
commit
be1c52e69a
5
assets/scripts/lib/ext/i18n.coffee
Normal file
5
assets/scripts/lib/ext/i18n.coffee
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
I18n.missingTranslation = ->
|
||||||
|
key = arguments[arguments.length - 1]
|
||||||
|
value = key.split('.').pop()
|
||||||
|
$.titleize(value)
|
||||||
|
|
|
@ -64,6 +64,10 @@ $.extend
|
||||||
string[0].toLowerCase() + string.substring(1).replace /([A-Z])?/g, (match, chr) ->
|
string[0].toLowerCase() + string.substring(1).replace /([A-Z])?/g, (match, chr) ->
|
||||||
if chr then "_#{chr.toUpperCase()}" else ''
|
if chr then "_#{chr.toUpperCase()}" else ''
|
||||||
|
|
||||||
|
titleize: (string) ->
|
||||||
|
$.capitalize(string).replace /_(.)?/g, (match, chr) ->
|
||||||
|
if chr then ' ' + chr.toUpperCase() else ''
|
||||||
|
|
||||||
camelize: (string, uppercase) ->
|
camelize: (string, uppercase) ->
|
||||||
string = if uppercase == false then $.underscore(string) else $.capitalize(string)
|
string = if uppercase == false then $.underscore(string) else $.capitalize(string)
|
||||||
string.replace /_(.)?/g, (match, chr) ->
|
string.replace /_(.)?/g, (match, chr) ->
|
||||||
|
|
|
@ -71,6 +71,7 @@ if window.history.state == undefined
|
||||||
@store = app.store
|
@store = app.store
|
||||||
$ => app.initialize()
|
$ => app.initialize()
|
||||||
|
|
||||||
|
require 'ext/i18n'
|
||||||
require 'travis/ajax'
|
require 'travis/ajax'
|
||||||
require 'app'
|
require 'app'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user