Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting language of course for Google Translate #499

Closed
johanlavenius opened this issue Feb 12, 2024 · 7 comments · Fixed by #500 or adaptlearning/adapt-contrib-spoor#310
Closed
Assignees

Comments

@johanlavenius
Copy link

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

  • Framework 5.31.10
  • Chrome (all versions)
  • Windows 10

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
Copy link
Member

oliverfoster commented Feb 12, 2024

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
Copy link
Author

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
Copy link
Member

Ok, cool.

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

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

@oliverfoster
Copy link
Member

Please try the two pull requests attached.

@oliverfoster oliverfoster moved this from Assigned to Needs Reviewing in adapt_framework: The TODO Board Feb 12, 2024
@johanlavenius
Copy link
Author

Works perfectly

@oliverfoster
Copy link
Member

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

@oliverfoster
Copy link
Member

🎉 This issue has been resolved in version 6.45.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment