From 917a61b3105784fb177e425dae8ef2612e2245e5 Mon Sep 17 00:00:00 2001 From: nixel2007 Date: Wed, 24 Dec 2014 22:15:52 +0300 Subject: [PATCH] Revert "Fixed i18n-coverage bug" This reverts commit 97cdb76b825b7a8a64ad0356d6527aa35bddd6b4. --- app/models/CocoModel.coffee | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/app/models/CocoModel.coffee b/app/models/CocoModel.coffee index baa2dbd37..e0e1be276 100644 --- a/app/models/CocoModel.coffee +++ b/app/models/CocoModel.coffee @@ -379,26 +379,8 @@ class CocoModel extends Backbone.Model updateI18NCoverage: -> i18nObjects = @findI18NObjects() return unless i18nObjects.length - - langCodeArrays = (_.keys(i18n) for i18n in i18nObjects) - langCodeArray = langCodeArrays[0] - temp_i18nCoverage = [] - schemaProps = (schemaProp for schemaProp in this.schema().properties.i18n.props when this.attributes.hasOwnProperty(schemaProp)) - - for lang in langCodeArray - - langProps = i18n[lang] - allProps = true - - for prop in schemaProps - if not langProps.hasOwnProperty(prop) - allProps = false - break - - if allProps - temp_i18nCoverage.push lang - - @set('i18nCoverage', temp_i18nCoverage) + langCodeArrays = (_.keys(i18n) for i18n in i18nObjects) + @set('i18nCoverage', _.intersection(langCodeArrays...)) findI18NObjects: (data, results) -> data ?= @attributes