mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-07 10:34:46 -04:00
Workaround for #2630: Programmable is weird.
This commit is contained in:
parent
0f124bdddc
commit
7fa782e7bd
1 changed files with 8 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
storage = require 'core/storage'
|
||||
deltasLib = require 'core/deltas'
|
||||
locale = require 'locale/locale'
|
||||
|
||||
class CocoModel extends Backbone.Model
|
||||
idAttribute: '_id'
|
||||
|
@ -399,12 +400,19 @@ class CocoModel extends Backbone.Model
|
|||
# use it to determine what properties actually need to be translated
|
||||
props = workingSchema.props or []
|
||||
props = (prop for prop in props when parentData[prop])
|
||||
#unless props.length
|
||||
# console.log 'props is', props, 'path is', path, 'data is', data, 'parentData is', parentData, 'workingSchema is', workingSchema
|
||||
# langCodeArrays.push _.without _.keys(locale), 'update' # Every language has covered a path with no properties to be translated.
|
||||
# return
|
||||
|
||||
return if 'additionalProperties' of i18n # Workaround for #2630: Programmable is weird
|
||||
|
||||
# get a list of lang codes where its object has keys for every prop to be translated
|
||||
coverage = _.filter(_.keys(i18n), (langCode) ->
|
||||
translations = i18n[langCode]
|
||||
_.all((translations[prop] for prop in props))
|
||||
)
|
||||
#console.log 'got coverage', coverage, 'for', path, props, workingSchema, parentData
|
||||
langCodeArrays.push coverage
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue