Improved error handling.

This commit is contained in:
Martin Edenhofer 2014-08-03 23:07:51 +02:00
parent af0ead3822
commit ee8a4333fd

View file

@ -143,9 +143,12 @@ class _i18nSingleton extends Spine.Module
translate: ( string, args... ) => translate: ( string, args... ) =>
# return '' on undefined # type convertation
if typeof string is 'boolean' if typeof string isnt 'string'
if string && string.toString
string = string.toString() string = string.toString()
# return '' on undefined
return '' if string is undefined return '' if string is undefined
return '' if string is '' return '' if string is ''