Fixes #3124 - Nested Tree Select value not translatable.

This commit is contained in:
Rolf Schmidt 2020-10-28 16:58:55 +01:00
parent 8e479ef4ee
commit 40936da562

View file

@ -42,15 +42,22 @@ class App.UiElement.ApplicationUiElement
else else
attribute.options[''] = '-' attribute.options[''] = '-'
@getConfigOptionList: (attribute) -> @getConfigOptionListArray: (attribute, selection) ->
result = []
for row in selection
if attribute.translate
row.name = App.i18n.translateInline(row.name)
if !_.isEmpty(row.children)
row.children = @getConfigOptionListArray(attribute, row.children)
result.push row
result
@getConfigOptionList: (attribute, children = false) ->
return if _.isEmpty(attribute.options) return if _.isEmpty(attribute.options)
selection = attribute.options selection = attribute.options
attribute.options = [] attribute.options = []
if _.isArray(selection) if _.isArray(selection)
for row in selection attribute.options = @getConfigOptionListArray(attribute, selection)
if attribute.translate
row.name = App.i18n.translateInline(row.name)
attribute.options.push row
else else
forceString = (s) -> forceString = (s) ->
return if !selection[s] || !selection[s].toString then '' else selection[s].toString() return if !selection[s] || !selection[s].toString then '' else selection[s].toString()