2014-10-27 20:11:48 -04:00
|
|
|
I18NEditModelView = require './I18NEditModelView'
|
|
|
|
LevelComponent = require 'models/LevelComponent'
|
|
|
|
|
|
|
|
module.exports = class I18NEditComponentView extends I18NEditModelView
|
2015-01-29 12:07:25 -05:00
|
|
|
id: 'i18n-edit-component-view'
|
2014-10-27 20:11:48 -04:00
|
|
|
modelClass: LevelComponent
|
|
|
|
|
|
|
|
buildTranslationList: ->
|
|
|
|
lang = @selectedLanguage
|
2014-11-23 13:21:58 -05:00
|
|
|
|
2014-10-27 20:11:48 -04:00
|
|
|
propDocs = @model.get('propertyDocumentation')
|
2014-11-23 13:21:58 -05:00
|
|
|
|
2014-10-27 20:11:48 -04:00
|
|
|
for propDoc, propDocIndex in propDocs
|
2014-11-23 13:21:58 -05:00
|
|
|
|
2014-10-27 20:11:48 -04:00
|
|
|
#- Component property descriptions
|
|
|
|
if i18n = propDoc.i18n
|
2015-01-29 12:07:25 -05:00
|
|
|
path = ['propertyDocumentation', propDocIndex]
|
2016-04-25 16:20:47 -04:00
|
|
|
@wrapRow "#{propDoc.name} name value", ['name'], propDoc.name, i18n[lang]?.name, path
|
2014-10-27 20:11:48 -04:00
|
|
|
if _.isObject propDoc.description
|
2014-11-23 13:21:58 -05:00
|
|
|
for progLang, description of propDoc.description
|
|
|
|
@wrapRow "#{propDoc.name} description (#{progLang})", ['description', progLang], description, i18n[lang]?[progLang]?.description, path, 'markdown'
|
2014-10-27 20:11:48 -04:00
|
|
|
else if _.isString propDoc.description
|
|
|
|
@wrapRow "#{propDoc.name} description", ['description'], propDoc.description, i18n[lang]?.description, path, 'markdown'
|
2014-10-28 12:41:51 -04:00
|
|
|
if context = propDoc.context
|
|
|
|
for key, value of context
|
2015-03-01 12:40:05 -05:00
|
|
|
@wrapRow "#{propDoc.name} context value", ['context', key], value, i18n[lang]?.context?[key], path
|
2014-10-27 20:11:48 -04:00
|
|
|
|
|
|
|
#- Component return value descriptions
|
|
|
|
if i18n = propDoc.returns?.i18n
|
2015-01-29 12:07:25 -05:00
|
|
|
path = ['propertyDocumentation', propDocIndex, 'returns']
|
2014-10-27 20:11:48 -04:00
|
|
|
d = propDoc.returns.description
|
|
|
|
if _.isObject d
|
2014-11-23 13:21:58 -05:00
|
|
|
for progLang, description of d.description
|
|
|
|
@wrapRow "#{propDoc.name} return val (#{progLang})", ['description', progLang], description, i18n[lang]?[progLang]?.description, path, 'markdown'
|
2014-10-27 20:11:48 -04:00
|
|
|
else if _.isString d
|
|
|
|
@wrapRow "#{propDoc.name} return val", ['description'], d, i18n[lang]?.description, path, 'markdown'
|
|
|
|
|
|
|
|
#- Component argument descriptions
|
|
|
|
if propDoc.args
|
|
|
|
for argDoc, argIndex in propDoc.args
|
|
|
|
if i18n = argDoc.i18n
|
2015-01-29 12:07:25 -05:00
|
|
|
path = ['propertyDocumentation', propDocIndex, 'args', argIndex]
|
2014-10-27 20:11:48 -04:00
|
|
|
if _.isObject argDoc.description
|
2014-11-23 13:21:58 -05:00
|
|
|
for progLang, description of argDoc.description
|
|
|
|
@wrapRow "#{propDoc.name} arg description #{argDoc.name} (#{progLang})", ['description', progLang], description, i18n[lang]?[progLang]?.description, path, 'markdown'
|
2014-10-27 20:11:48 -04:00
|
|
|
else if _.isString argDoc.description
|
|
|
|
@wrapRow "#{propDoc.name} arg description #{argDoc.name}", ['description'], argDoc.description, i18n[lang]?.description, path, 'markdown'
|