Skip to content

Add multilingual support for exercise descriptions and tips to be displayed in the exercise implementation #2928

Closed
AutoPING-TUI wants to merge 4 commits into
openHPI:mainfrom
AutoPING-TUI:multilang-text
Closed

Add multilingual support for exercise descriptions and tips to be displayed in the exercise implementation #2928
AutoPING-TUI wants to merge 4 commits into
openHPI:mainfrom
AutoPING-TUI:multilang-text

Conversation

@AutoPING-TUI

Copy link
Copy Markdown

Implements and closes #2743

To improve maintenance of exercises in multilingual teaching scenarios it would be great to provide exercises with exercise descriptions in several languages rather than working with translated copies of a task. CodeOcean has already multilingual support. However, it is restricted to its GUI. An promising approach can be Moodle's Multilang Content Filter: Attributes (lang="XX" and class="multilang") are used to indicate the multi-language nature and to specify the exact language of a content element. CSS is then used to control the visibility on the page.

When editing the exercise description the instructor had to use the suggested attributes as shown in the examples below:

Example 1 (separated paragraphs):
example1

Example 2 (Inline separation of multilingual text):

<p><span class="multilang" lang="de">Implementieren Sie eine Funktion, die für einen gegebenen Parameter entscheidet, ob er gerade oder ungerade ist.</span> <span class="multilang" lang="en">Implement a function that decides for a given parameter whether it is even or odd.</span></p>

German:
de

English:
en

Comment thread app/javascript/multilang_de.css
MrSerth

This comment was marked as resolved.

@Cbblr Cbblr force-pushed the multilang-text branch from ff93042 to 00f3e8f Compare June 3, 2025 10:30
AutoPING-TUI and others added 2 commits June 3, 2025 12:40
Aligning the code with the style of this repository.

Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>

@MrSerth MrSerth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adressing all my comments, I really appreciate it! Otherwise, I just made another minor suggestion.

💁‍♂️ We should squash some commits during merge to get a clean, linear history without too many small amendments caused by the review. Please, do not just "rebase" (nor "merge").

Comment thread docs/multilang.md Outdated
Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>
MrSerth added a commit that referenced this pull request Jul 1, 2025
Closes #2743
Merges #2928

Co-authored-by: Sebastian Serth <MrSerth@users.noreply.github.com>
@MrSerth

MrSerth commented Jul 1, 2025

Copy link
Copy Markdown
Member

I've just rebased the branch on the latest main, executed all specs (and linters) and finally merged it with 7d4dd2c. Thanks agian for your contribution! 🎉

Unfortunately, I wasn't able to push the changes to the remote branch first, since the fork wasn't created in a personal account (but another organization). This seems to be a limitation in the "Allow maintainers to edit this PR" setting.

@MrSerth MrSerth closed this Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants