File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -378,8 +378,11 @@ H5P.init = function (target) {
378378 // Insert H5Ps that should be in iframes.
379379 H5P . jQuery ( 'iframe.h5p-iframe:not(.h5p-initialized)' , target ) . each ( function ( ) {
380380 var contentId = H5P . jQuery ( this ) . addClass ( 'h5p-initialized' ) . data ( 'content-id' ) ;
381+ const contentData = H5PIntegration . contents [ 'cid-' + contentId ] ;
382+ const language = contentData && contentData . metadata && contentData . metadata . defaultLanguage
383+ ? contentData . metadata . defaultLanguage : 'en' ;
381384 this . contentDocument . open ( ) ;
382- this . contentDocument . write ( '<!doctype html><html class="h5p-iframe"><head>' + H5P . getHeadTags ( contentId ) + '</head><body><div class="h5p-content" data-content-id="' + contentId + '"/></body></html>' ) ;
385+ this . contentDocument . write ( '<!doctype html><html class="h5p-iframe" lang="' + language + '" ><head>' + H5P . getHeadTags ( contentId ) + '</head><body><div class="h5p-content" data-content-id="' + contentId + '"/></body></html>' ) ;
383386 this . contentDocument . close ( ) ;
384387 } ) ;
385388} ;
You can’t perform that action at this time.
0 commit comments