mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-31 07:12:49 -04:00
Fix #2926: handle missing sub-code/spoken-languages in docs
This commit is contained in:
parent
96605127c6
commit
d200ac4a32
1 changed files with 6 additions and 3 deletions
|
@ -100,12 +100,15 @@ module.exports = class DocFormatter
|
|||
obj[prop] = null
|
||||
|
||||
# Translate into chosen spoken language.
|
||||
if val = obj[prop]
|
||||
if val = originalVal = obj[prop]
|
||||
context = @doc.context
|
||||
obj[prop] = val = utils.i18n obj, prop
|
||||
# For multiplexed-by-both-code-and-spoken-language objects, now also get code language again.
|
||||
if _.isObject val
|
||||
obj[prop] = val = obj[prop]?[@options.language]
|
||||
if _.isObject(val)
|
||||
if valByCodeLanguage = obj[prop]?[@options.language]
|
||||
obj[prop] = val = valByCodeLanguage
|
||||
else
|
||||
obj[prop] = originalVal # Never mind, we don't have that code language for that spoken language.
|
||||
if @doc.i18n
|
||||
spokenLanguage = me.get 'preferredLanguage'
|
||||
while spokenLanguage
|
||||
|
|
Loading…
Add table
Reference in a new issue