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.
Our courses have been updated every year but translations aren't available for the latest year until much later. Once a course for a particular year has been fully translated into a language, we then mark the course as available in the language. To show this in the UI, we have a little
Recommended
tag next to the version year of the course. So you would see something like2017 (Recommended)
. However, at some point front end code broke and we stopped recommending the correct year for non-English languages. This PR makes it so the correct year is recommended when a teacher is creating a new section and when a teacher browsing the course overview page.The root cause of this bug was that the English name of a language was being used to see if it was in the list of available languages. At some point, the list of available languages started using native name for the language, rather than the English version. I could have fixed this by using the native language name instead, but I felt a better solution is to use the 4 letter locale code ??-?? (en-US, es-ES, etc) instead because it wouldn't be affected by translation changes. A lot of this PR is simply passing around the 4 letter locale codes and relying on that instead of the locale names.
Links
Testing story
Screenshots
Before
Note that 2017 should be the recommended course year.
After
Before
Note that 2017 should be the recommended course year.
After
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: