Skip to content
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: Add fr-CA locale #1511

Closed
wants to merge 2 commits into from
Closed

feat: Add fr-CA locale #1511

wants to merge 2 commits into from

Conversation

erakis
Copy link

@erakis erakis commented Oct 29, 2020

Related: #1510

{{ briefly describe what you have done in this PR }}

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)

@codecov
Copy link

codecov bot commented Oct 29, 2020

Codecov Report

Merging #1511 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1511   +/-   ##
=======================================
  Coverage   99.92%   99.92%           
=======================================
  Files          96       96           
  Lines        1277     1278    +1     
=======================================
+ Hits         1276     1277    +1     
  Misses          1        1           
Impacted Files Coverage Δ
src/lib/alpha.js 100.00% <100.00%> (ø)
src/lib/isMobilePhone.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bab507a...632c77a. Read the comment docs.

Copy link
Member

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contrib! 🎉

@profnandaa
Copy link
Member

Please fix the merge conflicts.

/cc. @ezkemboi -- kindly review.

Copy link
Member

@tux-tn tux-tn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contrib! Can you check my comments concerning the decimal separator and the regex

@@ -106,7 +108,7 @@ for (let locale, i = 0; i < farsiLocales.length; i++) {
}

// Source: https://en.wikipedia.org/wiki/Decimal_mark
export const dotDecimal = ['ar-EG', 'ar-LB', 'ar-LY'];
export const dotDecimal = ['ar-EG', 'ar-LB', 'ar-LY', 'fr-CA'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to many sources (even the link in the code comment) francophone area of Canada (fr-CA) are using decimal comma separator. Can you check this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your're right I made a mistake. I'm in Quebec (canada-french) and most people i work with hate decimals for numbers. I was sure we had the same standard as English.

So yes, in french this is the decimal and not the point. Sorry

@@ -9,6 +9,7 @@ export const alpha = {
'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i,
'fa-IR': /^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,
'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
'fr-CA': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's the same regex for fr-FR and fr-CA may be we should just assign the value like it was done for pt-BR and all arabic locales

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course.

@@ -42,6 +43,7 @@ export const alphanumeric = {
'el-GR': /^[0-9Α-ω]+$/i,
'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
'fr-CA': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, doing alphanumeric['fr-CA'] = alphanumeric['fr-FR'] would be easier/better since it's the same regex

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course²

@erakis
Copy link
Author

erakis commented Nov 20, 2020

@tux-tn

However, I am on preventive leave due to COVID cases in my family, so I will not be able to correct this in a few days. Can you make the changes?

Also, thanks for the review and the suggestions.

@tux-tn
Copy link
Member

tux-tn commented Nov 20, 2020

Sorry, i don't have write access on master in order to make changes to your Pull request. I guess it can wait few days. Stay safe and take care!

@profnandaa
Copy link
Member

profnandaa commented Nov 23, 2020 via email

@tux-tn
Copy link
Member

tux-tn commented Nov 23, 2020

I didn't know that, thank you for the info @profnandaa

@profnandaa
Copy link
Member

@tux-tn -- however, you will need to make a separate PR

@profnandaa profnandaa added the 🧹 needs-update For PRs that need to be updated before landing label Nov 25, 2020
@tux-tn
Copy link
Member

tux-tn commented Nov 25, 2020

@profnandaa already did

@profnandaa
Copy link
Member

closing in favor of #1528

@profnandaa profnandaa closed this Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧹 needs-update For PRs that need to be updated before landing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants