Fix i18nCoverage bug

Sometimes, translations is undefined, so check that it exists
This commit is contained in:
Scott Erickson 2016-08-23 13:33:51 -07:00
parent 24848da7bf
commit 7d9d42a23f

View file

@ -426,7 +426,7 @@ class CocoModel extends Backbone.Model
# get a list of lang codes where its object has keys for every prop to be translated # get a list of lang codes where its object has keys for every prop to be translated
coverage = _.filter(_.keys(i18n), (langCode) -> coverage = _.filter(_.keys(i18n), (langCode) ->
translations = i18n[langCode] translations = i18n[langCode]
_.all((translations[prop] for prop in props)) translations and _.all((translations[prop] for prop in props))
) )
#console.log 'got coverage', coverage, 'for', path, props, workingSchema, parentData #console.log 'got coverage', coverage, 'for', path, props, workingSchema, parentData
langCodeArrays.push coverage langCodeArrays.push coverage