Problem/Motivation

When multilingual is enabled on LMS, the courses view always displays courses using the site's default language if that translation is available on the content. While this can be partially rectified by filtering for courses matching the UI's current language, key content still renders as the default language, including the course name and link.

Steps to reproduce

Apply the changes from https://www.drupal.org/project/lms/issues/3586791
Enable translation on courses, omitting the Start Link.
Translate the course name into another language.
Go to /courses in the default language (this should display as expected).
Go to /courses in another language, translated courses will still show the default language.

Proposed resolution

Alter the CourseCardRow plugin to inject the Language Manager.
In ::buildCard(), check if the entity has a translation in the current language.
Call ::getTranslation() on the entity to get correct language output.

Remaining tasks

Create patch.

User interface changes

Views using the CourseCardRow will become language aware.

API changes

None.

Data model changes

None.

Issue fork lms-3588830

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

socketwench created an issue.