Skip to content

Commit

Permalink
BUGFIX: Prevent JS error with missing translations
Browse files Browse the repository at this point in the history
The package uses language labels for javascript options and when
the language not exists the option for qualityBadge (an object) leads
to an javascript error. So we are now using the english language as default.
  • Loading branch information
markusguenther authored Oct 14, 2019
1 parent 3519b1b commit 7c521d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Resources/Private/Fusion/Prototypes/Javascript.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ prototype(Jonnitto.Plyr:Javascript) < prototype(Neos.Fusion:Array) {
i18n = Neos.Fusion:Collection {
collection = ${['restart','rewind','play','pause','fastForward','seek','seekLabel','played','buffered','currentTime','duration','volume','mute','unmute','enableCaptions','disableCaptions','enterFullscreen','exitFullscreen','frameTitle','captions','settings','menuBack','speed','normal','quality','loop','start','end','all','reset','disabled','enabled','advertisement','qualityBadge']}
itemRenderer = Neos.Fusion:Value {
translation = ${Translation.translate(item, null, [], null, 'Jonnitto.Plyr')}
englishDefault = ${Translation.translate(item, null, [], null, 'Jonnitto.Plyr', null, 'en')}
translation = ${Translation.translate(item, this.englishDefault, [], null, 'Jonnitto.Plyr')}
wrappedTranslation = ${item == 'qualityBadge' ? this.translation : ("'" + this.translation + "'")}
value = ${item + ":" + this.wrappedTranslation + (iterator.isLast ? '' : ',')}
}
Expand Down

0 comments on commit 7c521d9

Please sign in to comment.