Translate display names and descriptions for lesson extras #39969
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
FND-1467
This change does 2 things
Before (https://studio.code.org/s/coursef-2020/stage/3/extras/lang/es-mx)
After (on localhost)
Testing story
Ran
sync-in.rb
to producei18n/locales/source/course_content/2020/coursef-2020.json
below. Verified it could extract the level'sdisplay_name
andbubble_choice_description
.Created a fake
sync-down
result ati18n/locales/es-MX/course_content/2020/coursef-2020.json
with translationsRan
sync-out.rb
and verified that the display name and description are distributed correctly todashboard/config/locales/display_name.es-MX.json
and
dashboard/config/locales/bubble_choice_description.es-MX.json
.Verified that lesson extra were displayed correctly in different languages
Verified that the rendering code is safe against user-generated content.
Rendering
display_name
:code-dot-org/apps/src/code-studio/components/SublevelCard.jsx
Lines 193 to 199 in 97de9db
Rendering
description
:code-dot-org/apps/src/code-studio/components/SublevelCard.jsx
Lines 202 to 207 in 97de9db
Both are safe because we just treat them as plain strings.
PR Checklist: