Add non-English prop and grades translations in Curriculum Catalog Card - #51302
Conversation
91a6101 to
614af92
Compare
davidsbailey
left a comment
There was a problem hiding this comment.
Nice work Meg! LGTM once requested test cases are added and passing.
regarding plurals, I have ideas here (which i've shared previously) but am not an expert on the actual capabilities of our current system. I would recommend reaching out to the platform team to get the info you need here. I see you tagged foundations, but they get a lot of PRs (anything tagged with i18n), so don't hesitate to also reach out via slack.
| youngestGrade: gradesArray[0], | ||
| oldestGrade: gradesArray[gradesArray.length - 1] | ||
| }) | ||
| } |
There was a problem hiding this comment.
the overall approach for how to handle grading data seems good to me 👍
| assert_creates CourseOffering do | ||
| CourseOffering.create!(key: 'test-key-one-grade', display_name: 'Test One Grade', grade_levels: 'K') | ||
| end | ||
| end |
There was a problem hiding this comment.
thank you for the excellent validation and tests! grades seem like a surprisingly annoying problem for something which seems so simple at first, so this effort seems well spent.
a couple more test cases to throw at you:
'10,11,12'- a couple other passing test cases, reflecting common uses
'K,K,1'
There was a problem hiding this comment.
Oh the K,K,1 is clever! Just added more tests
Good thing you asked about reaching out to the platform team! I had done that https://codedotorg.slack.com/archives/CFTFD6BPV/p1681305819638809 but still used the wrong documentation, which was why nothing was matching / working! Got it working now 🎉 UPDATE: See code-dot-org/apps/i18n/fish/ga_ie.json Line 51 in 79e0ce0 |
| "grade": "Grade", | ||
| "gradeRange": "Grades: {youngest_grade}-{oldest_grade}", | ||
| "gradeRange": "{numGrades, plural, one {Grade: {youngestGrade}} other {Grades: {youngestGrade}-{oldestGrade}}}", |
There was a problem hiding this comment.
I don't expect you to change anything since this is probably a core issue with our platform, but this is just a thought I had: I imagine "Age" would be a more universal attribute across cultures rather than the specific US education concept of a "Grade".
There was a problem hiding this comment.
Yes, good call. We'll use the user's country to determine if we show age (outside the US) or grade (inside the US), but that's happening in version 2.

This PR does three things:
Pass in hard-coded
isTranslatedanddurationprops (follow-up from previous PR)Pass in
isEnglishprop from backend using LocaleHelperSpanish:

English UK:

Single Grade:

More than one grade:

Links
MessageFormat documentation for the translatable strings: http://messageformat.github.io/messageformat/guide/#pluralformat
Thread about translation strategy
Another language (Gaelic in Ireland!) using multiple plurals:
code-dot-org/apps/i18n/fish/ga_ie.json
Line 51 in 79e0ce0
Incredible chart of plural rules in different languages https://www.unicode.org/cldr/charts/43/supplemental/language_plural_rules.html
Testing story
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: