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

refactor(TranslatableInput): Use two inputs instead of content projection #1618

Conversation

hirokiterashima
Copy link
Member

Changes

  • 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.
  • Note that prompt authoring has not been converted yet, because it uses a textarea instead of an input

Test

  • Inputs that have been converted to TranslatableInputs (MC choice and feedback authoring, Match choice and source bucket name) work as before, including
    • showing text, label, placeholder in default and translated languages
    • saving text in default and translated languages. Note that at the moment, saving only works in translated language if translation already exists in the translation file.

projection

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.
@hirokiterashima hirokiterashima self-assigned this Feb 6, 2024
@hirokiterashima hirokiterashima marked this pull request as ready for review February 7, 2024 17:08
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, functionality works well.

@breity breity self-requested a review February 7, 2024 18:10
@hirokiterashima hirokiterashima merged commit 8ce4ce2 into issue-1513-multiple-languages-per-unit Feb 7, 2024
@hirokiterashima hirokiterashima deleted the translation-input-use-two-inputs-instead-of-content-projection branch February 7, 2024 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants