-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: adding support for Welsh and es-ES #81
Conversation
@@ -738,6 +738,18 @@ export function getDateTimeDescriptor() { | |||
weekendStartDay = 4; | |||
weekendEndDay = 5; | |||
break; | |||
case 'cy': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of this I grabbed from the monolith's LOCALE_CULTURE table and lang terms, the rest from the CLDR.
@@ -763,7 +775,7 @@ export function getDateTimeDescriptor() { | |||
]; | |||
break; | |||
case 'es': | |||
dateFormats = ['dddd d\' de \'MMMM\' de \'yyyy', 'd\' de \'MMMM\' de \'yyyy', 'd/M/yyyy', 'MMMM yyyy', 'd\' de \'MMMM', 'd\' de \'MMM']; | |||
dateFormats = ['dddd d\' de \'MMMM\' de \'yyyy', 'd\' de \'MMMM\' de \'yyyy', 'dd/MM/yyyy', 'MMMM yyyy', 'd\' de \'MMMM', 'd\' de \'MMM']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a slight deviation here in the base es
data we had, but now that the monolith has es-ES
and it was the same as es-MX
I've combined them.
@@ -116,6 +116,7 @@ export function getNumberDescriptor() { | |||
let percentPattern = '{number} %'; | |||
let percentNegativePattern = '-{number} %'; | |||
switch (baseLanguage) { | |||
case 'es': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here -- we were treating Mexico differently, but inspecting the data the monolith has for es-MX
I noticed it matches es-ES
so combining them.
{ locale: 'fr-CA', expect: ['01 h 28', '1:28 AM', '01 h 28 EST', '1:28 AM EST', '13 h 52', '1:52 PM', '13 h 52 EST', '1:52 PM EST'] }, | ||
{ locale: 'fr-FR', expect: ['01 h 28', '1:28 AM', '01 h 28 EST', '1:28 AM EST', '13 h 52', '1:52 PM', '13 h 52 EST', '1:52 PM EST'] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a bit of alphabetizing.
dateFormats = ['dddd, d MMMM yyyy', 'dd MMMM yyyy', 'dd/MM/yyyy', 'MMMM yyyy', 'd MMMM', 'd MMM']; | ||
months = [ | ||
['Ionawr', 'Chwefror', 'Mawrth', 'Ebrill', 'Mai', 'Mehefin', 'Gorffennaf', 'Awst', 'Medi', 'Hydref', 'Tachwedd', 'Rhagfyr'], | ||
['Ion', 'Chwe', 'Maw', 'Ebr', 'Mai', 'Meh', 'Gor', 'Awst', 'Medi', 'Hyd', 'Tach', 'Rhag'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like Chwe
should just be Chw
(unless I'm looking at the wrong section of the table which is possible since it's giant - https://www.unicode.org/cldr/cldr-aux/charts/25/summary/cy.html#1404)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ignored the CLDR for this stuff and pulled these from the monolith here:
https://search.d2l.dev/xref/lms/lp/_lang/LangTerms/translations/cy-gb/Standard.xml?r=760bcabb#1463
Not to say there aren't mistakes in there as I did find a legit one that I sent to be addressed.
@@ -331,6 +333,7 @@ describe('number', () => { | |||
[ | |||
{ locale: 'ar', expect: ['42 %', '-42 %'] }, | |||
{ locale: 'ar-SA', expect: ['42 %', '-42 %'] }, | |||
{ locale: 'cy-GB', expect: ['42 %', '-42 %'] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welsh looks to not have the space between number and % (https://www.unicode.org/cldr/cldr-aux/charts/25/summary/cy.html#3303)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm... they're gonna hate my d2l-input-percent
. 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe they will ❤️ it, and everyone else will dislike. 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So again, I went with what the monolith has which has the space. I'm not sure what's "right" and I've raised issues against deviations in the monolith before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha the only people who will hate your percent input Dave are those who put the percent first -- % 9
... which is just Turkish out of the locales we support.
🎉 This PR is included in version 3.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This adds support for Welsh (
cy-GB
) andes-ES
.