Part 3: adding logic to translate on rails side - #51063
Merged
Merged
Conversation
hannahbergam
marked this pull request as ready for review
April 4, 2023 22:12
bethanyaconnor
approved these changes
Apr 5, 2023
bethanyaconnor
left a comment
Contributor
There was a problem hiding this comment.
🎉 thanks for sticking with this!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This completes the work started in #51056 and #51055, which adds translations for course offering headers.
I am translating these on the rails side with inspiration from localized_display_name.
The default:nil ensures that a failed translation returns the original header instead of the translation error message. This also allows us to keep the test cases the same.
Here are some photos to help show that these headers are indeed pulling from the en.yml file. This is not code I've committed- it's just for testing purposes
I changed the labs and skills header to 'Test Header' in the translations file to see if it would appear on the page, and it does:

Links
Testing story
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: