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

feat(Multilingual Unit): Authoring and Student #1617

Merged
merged 101 commits into from
Aug 5, 2024

Conversation

hirokiterashima
Copy link
Member

@hirokiterashima hirokiterashima commented Feb 6, 2024

Notes

Changes

  • Authors can now translate a unit into multiple languages
  • Students can now see a unit in the different languages

Test

  • Translate unit into multiple languages in the AT
  • Switch between the different languages in the VLE
  • Single-unit languages work as before in AT, CM, and VLE

Closes #1513

hirokiterashima and others added 30 commits November 29, 2023 09:40
Implement switching between languages of the unit content in in student and preview. A language select drop-down will appear if project has locale settings.
Allow authors to select default language and supported languages
- Change i18nId: string to i18n: { id: string, modified: number }
- Rename translation files from project.es.json -> translations.es.json
- Change ProjectLanguageChooser to take in ProjectLocale as input and emit selected Language as output. This will let us reuse this component in the AT.
- Move ProjectLanguageChooser to common folder and show it in the AT's TopBarComponent. Update options when author changes them in the Project info view
Create TranslatableInputComponent to show translated text for the
current language. Converted some inputs in MC and Match authoring to use
TranslatableInputComponent
…s the upper right language drop down options the same even though it should change. Also removes project info/runcode at at-top-bar if we're showing the unit listing view.
…ranslatable input box (#1583)

Show default language text hint below the translatable input box. This only appears when the current language is not the default language.
…atableInput (#1585)

* Pass in ComponentContent to EditComponentPrompt instead of prompt. This
will let us convert the input to TranslatableInput.
* Convert EditComponentPrompt input into TranslatableInput
In the AT, the tooltip now says "Choose Lanauge to Translate"
…s label (#1588)

This helps the translator know to type the translation for the currently-selected language.
…ringComponentModule

This will let us import the module and only make changes to it instead
of to all the component spec files whenever we need to add new
dependencies.
POSTs to an endpoint to save the translations for a locale each time an existing translation text is updated.
…tion (#1618)

Pass in required values (label, placeholder) and output (defaultLanguageTextChanged) into the TranslatableInputComponent. This will let us use two inputs and switch between them based on whether we're translating or not. This will allow us to style the input more easily.
ComponentAuthoringModule

This will make it easier to add TranslatableTextarea to
ComponentAuthoringModule in the future because we won't need to reimport
it to the specific component spec files
Modify EditComponentPromptComponent to use this new component
This change set allows translators to save translations for fields that have never been translated into another language before. It requires adding a new i18n field to the default language unit JSON, and using the new i18nId to save the new translation
…only contains default language's text. Before, it contained text & language code, which made it hard to reuse the variable in child classes.
Create TranslatableRichTextareaComponent and use this component to allow translators to translate html components.
@hirokiterashima hirokiterashima marked this pull request as ready for review August 1, 2024 15:34
@hirokiterashima hirokiterashima added the enhancement New feature of any size or improvement (UI, performance, security) label Aug 1, 2024
@hirokiterashima hirokiterashima changed the title (draft) Issue 1513 multiple languages per unit feat(Multilingual Unit): Authoring and Student Aug 1, 2024
Copy link
Member

@breity breity left a comment

Choose a reason for hiding this comment

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

Looks good. 🥳

Copy link
Member

@geoffreykwan geoffreykwan left a comment

Choose a reason for hiding this comment

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

Looks good.

@hirokiterashima hirokiterashima merged commit 57dc596 into develop Aug 5, 2024
4 of 5 checks passed
@hirokiterashima hirokiterashima deleted the issue-1513-multiple-languages-per-unit branch August 5, 2024 20:16
@geoffreykwan
Copy link
Member

🎉 This PR is included in version 5.155.0 🎉

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
Labels
enhancement New feature of any size or improvement (UI, performance, security) released
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Multiple languages per unit
3 participants