-
Notifications
You must be signed in to change notification settings - Fork 56
Add Tunisian Arabic (ar_TN) localization support to intl package #1012
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @mohamed-yahyaoui, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces comprehensive localization support for Tunisian Arabic (ar_TN) into the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds localization support for Tunisian Arabic (ar_TN
), which is a valuable contribution. The changes include new data for date/time symbols, number formatting, and pluralization rules, along with corresponding tests.
My review has identified a few issues that need attention:
- The
new
keyword is used in a few places, which goes against Effective Dart style guidelines. - The currency code for
ar_TN
is incorrect. - Most importantly, the compact number symbols for
ar_TN
are missing, even though tests for them have been added.
Additionally, there's a small typo in the PR description where 'tk'
is mentioned instead of 'ar_TN'
.
Once these issues are addressed, this PR will be in great shape. Thank you for your work on this!
"ar_TN": [ | ||
["1", "1", "1"], | ||
["21", "21", "21"], | ||
["321", "321", "321"], | ||
["4321", "4,3 ألف", "4,3 ألف"], | ||
["54321", "54 ألف", "54 ألف"], | ||
["654321", "654 ألف", "654 ألف"], | ||
["7654321", "7,7 مليون", "7,7 مليون"], | ||
["87654321", "88 مليون", "88 مليون"], | ||
["987654321", "988 مليون", "988 مليون"], | ||
["1087654321", "1,1 مليار", "1,1 مليار"], | ||
["11987654321", "12 مليار", "12 مليار"], | ||
["129987654321", "130 مليار", "130 مليار"], | ||
["1398987654321", "1,4 ترليون", "1,4 ترليون"], | ||
["14987987654321", "15 ترليون", "15 ترليون"], | ||
["159876987654321", "160 ترليون", "160 ترليون"], | ||
["9", "9", "9"], | ||
["99", "99", "99"], | ||
["999", "999", "999"], | ||
["9999", "10 ألف", "10 ألف"], | ||
["99999", "100 ألف", "100 ألف"], | ||
["999999", "1 مليون", "1 مليون"], | ||
["9999999", "10 مليون", "10 ملايين"], | ||
["99999999", "100 مليون", "100 مليون"], | ||
["9994", "10 ألف", "10 ألف"], | ||
["99944", "100 ألف", "100 ألف"], | ||
["999444", "999 ألف", "999 ألف"], | ||
["9994444", "10 مليون", "10 ملايين"], | ||
["999444444", "999 مليون", "999 مليون"], | ||
["9994444444", "10 مليار", "10 مليار"], | ||
["1000000000000000", "1000 ترليون", "1000 ترليون"], | ||
["10000000000000000", "10000 ترليون", "10000 ترليون"], | ||
["0", "0", "0"], | ||
["-1", "-1", "-1"], | ||
["-2", "-2", "-2"], | ||
["-3", "-3", "-3"], | ||
["-1000", "-1 ألف", "-1 ألف"], | ||
["-1001", "-1 ألف", "-1 ألف"], | ||
["-1010", "-1 ألف", "-1 ألف"], | ||
["-1100", "-1,1 ألف", "-1,1 ألف"], | ||
["-2000", "-2 ألف", "-2 ألف"], | ||
["-2001", "-2 ألف", "-2 ألف"], | ||
["-2010", "-2 ألف", "-2 ألف"], | ||
["-2100", "-2,1 ألف", "-2,1 ألف"], | ||
["-9", "-9", "-9"], | ||
["-99", "-99", "-99"], | ||
["-999", "-999", "-999"], | ||
["-9999", "-10 ألف", "-10 ألف"], | ||
["-99999", "-100 ألف", "-100 ألف"], | ||
["-999999", "-1 مليون", "-1 مليون"], | ||
["-9999999", "-10 مليون", "-10 ملايين"], | ||
["-9999999999999999", "-10000 ترليون", "-10000 ترليون"], | ||
["1000", "1 ألف", "1 ألف"], | ||
["1001", "1 ألف", "1 ألف"], | ||
["1010", "1 ألف", "1 ألف"], | ||
["1100", "1,1 ألف", "1,1 ألف"], | ||
["2000", "2 ألف", "2 ألف"], | ||
["2001", "2 ألف", "2 ألف"], | ||
["2010", "2 ألف", "2 ألف"], | ||
["2100", "2,1 ألف", "2,1 ألف"], | ||
["3000", "3 آلاف", "3 آلاف"], | ||
["3001", "3 آلاف", "3 آلاف"], | ||
["3010", "3 آلاف", "3 آلاف"], | ||
["3100", "3,1 ألف", "3,1 ألف"], | ||
["4000", "4 آلاف", "4 آلاف"], | ||
["4001", "4 آلاف", "4 آلاف"], | ||
["4010", "4 آلاف", "4 آلاف"], | ||
["4100", "4,1 ألف", "4,1 ألف"], | ||
["5000", "5 آلاف", "5 آلاف"], | ||
["5001", "5 آلاف", "5 آلاف"], | ||
["5010", "5 آلاف", "5 آلاف"], | ||
["5100", "5,1 ألف", "5,1 ألف"], | ||
["0.001234", "0,0012", "0,0012"], | ||
["0.01234", "0,012", "0,012"], | ||
["0.1234", "0,12", "0,12"], | ||
["0.99", "0,99", "0,99"], | ||
["0.999", "1", "1"], | ||
["9.12", "9,1", "9,1"], | ||
["9.99", "10", "10"], | ||
["99.12", "99", "99"], | ||
["99.99", "100", "100"], | ||
["999.12", "999", "999"], | ||
["999.99", "1 ألف", "1 ألف"], | ||
["9999.12", "10 ألف", "10 ألف"], | ||
["9999.99", "10 ألف", "10 ألف"], | ||
["-0.12", "-0,12", "-0,12"], | ||
["-0.99", "-0,99", "-0,99"], | ||
["-9.12", "-9,1", "-9,1"], | ||
["-9.99", "-10", "-10"], | ||
["-999.12", "-999", "-999"], | ||
["-999.99", "-1 ألف", "-1 ألف"], | ||
["-9999.12", "-10 ألف", "-10 ألف"], | ||
["-9999.99", "-10 ألف", "-10 ألف"], | ||
], |
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.
These tests for ar_TN
compact number formatting are a great addition. However, the corresponding compact number symbols for ar_TN
are missing from the compactNumberSymbols
map in pkgs/intl/lib/number_symbols_data.dart
. Without this, the tests will fall back to the ar
locale, which may not have the correct Tunisian-specific formats. Please add an entry for ar_TN
to the compactNumberSymbols
map.
PERCENT_PATTERN: '#,##0%', | ||
CURRENCY_PATTERN: | ||
'\u200F#,##0.000\u00A0\u00A4;\u200F-#,##0.000\u00A0\u00A4', | ||
DEF_CURRENCY_CODE: 'DT'), |
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.
WEEKENDRANGE: const [4, 5], | ||
FIRSTWEEKCUTOFFDAY: 4), | ||
// Date/time formatting symbols for locale ar_TN. | ||
"ar_TN": new DateSymbols( |
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.
CURRENCY_PATTERN: '\u200F#,##0.00\u00A0\u00A4', | ||
DEF_CURRENCY_CODE: 'EGP'), | ||
// Number formatting symbols for locale ar_TN. | ||
"ar_TN": new NumberSymbols( |
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.
The i18n data is pulled from CLDR data - so please file a PR there, or, if the data is already present, open an issue here to add this locale to the list of supported locales. Do keep in mind that we are currently trying out package:intl4x as a replacement to package:intl - so if that fits your needs, there might be no need for this request at all. |
Summary
This PR adds support for the Tunisian Arabic (ar_TN) locale to the intl package.
ar_TN.json
files for date symbols and date patternsar_TN
ar_TN
ar_TN
ar_TN
Testing
Ran example code with
Intl.defaultLocale = 'tk'
and confirmed correct formattingCalled
initializeDateFormatting('tk', null)
and verified no errorsNotes
Please let me know if any additional data or changes are needed.