adaptlearning / adapt-contrib-core

Adapt Framework kernel. Responsible for boot loading, data loading and core APIs.
GNU General Public License v3.0
3 stars 17 forks source link

Setting language of course for Google Translate #499

Closed johanlavenius closed 9 months ago

johanlavenius commented 9 months ago

Subject of the issue/enhancement/features

index_lms.html contains and is not reflecting the language of the course and Chrome translates the course with "wrong words" when certain settings is used.

Your environment

Steps to reproduce

Create a course in Swedish. Use for example the Swedish word "Hat" (Meaning hate). In Chrome (chrome://settings/languages) activate Google Translate. Set Translate to Swedish. Add English to the list of languages that should be translated automatically.

Expected behaviour

The example swedish word "Hat" should still show up as the swedish word "Hat".

Actual behaviour

The swedish word "Hat" is translated to "Hatt" (Its also a swedish word meaning hat. The thing you wear on your head).

This translation can be difficult to find in a long course. Most of the words seems just fine.

Suggestion

The lang-attribute should reflect the language setting of the course or a separate setting in adapt-contrib-spoor.

oliverfoster commented 9 months ago

The _defaultLanguage of the config.json may help. You should just need to set it to sv and change the course/en folder to course/sv. This code in Adapt should do the rest for you.

We also have this readme and tooling on translations and a plugin for multi language courses called adapt-contrib-languagePicker

Spoor, this extension, is really only for implementing the SCORM API to communicate with an LMS.

johanlavenius commented 9 months ago

I know about the _defaultLanguage in the config.json but that doesn´t fix the problem. Maybe it fires too late? Maybe Chrome checks the lang-attribute with javascript turned off.

If i manually change the lang-attribute in the index_lms.html from en to sv all is working as expected.

oliverfoster commented 9 months ago

Ok, cool.

References: https://www.matuzo.at/blog/lang-attribute/ https://github.com/vuejs/vue-cli/issues/5945 https://github.com/h5bp/html5-boilerplate/issues/1542

I'm going to move this issue to adapt-contrib-core and have a brief look.

oliverfoster commented 9 months ago

Please try the two pull requests attached.

johanlavenius commented 9 months ago

Works perfectly

oliverfoster commented 9 months ago

Could you please mark your satisfaction on both prs? We have a 3 review protocol to get them merged.

oliverfoster commented 9 months ago

:tada: This issue has been resolved in version 6.45.5 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: