mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
parent
d74a86d06a
commit
917a61b310
1 changed files with 2 additions and 20 deletions
|
@ -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)
|
||||
@set('i18nCoverage', _.intersection(langCodeArrays...))
|
||||
|
||||
findI18NObjects: (data, results) ->
|
||||
data ?= @attributes
|
||||
|
|
Loading…
Reference in a new issue