Improved error handling.
This commit is contained in:
parent
af0ead3822
commit
ee8a4333fd
1 changed files with 7 additions and 4 deletions
|
@ -143,9 +143,12 @@ class _i18nSingleton extends Spine.Module
|
|||
|
||||
translate: ( string, args... ) =>
|
||||
|
||||
# return '' on undefined
|
||||
if typeof string is 'boolean'
|
||||
# type convertation
|
||||
if typeof string isnt 'string'
|
||||
if string && string.toString
|
||||
string = string.toString()
|
||||
|
||||
# return '' on undefined
|
||||
return '' if string is undefined
|
||||
return '' if string is ''
|
||||
|
||||
|
|
Loading…
Reference in a new issue