Skip to content

Conversation

mohamed-yahyaoui
Copy link

Summary

This PR adds support for the Tunisian Arabic (ar_TN) locale to the intl package.

  • Added ar_TN.json files for date symbols and date patterns
  • Updated locale_list to include ar_TN
  • Added date, number, and compact number symbols for ar_TN
  • Updated plural rules to support ar_TN
  • Added test data for number and compact number formatting for ar_TN
  • Verified formatting and pluralization for the new locale

Testing
Ran example code with Intl.defaultLocale = 'tk' and confirmed correct formatting
Called initializeDateFormatting('tk', null) and verified no errors

Notes

Please let me know if any additional data or changes are needed.

Copy link

Summary of Changes

Hello @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 intl package. It integrates all necessary cultural data for date, time, and number formatting, along with appropriate pluralization rules. This addition enables applications to accurately display and format content for users in Tunisia, enhancing the package's global reach and user experience.

Highlights

  • New Locale Support: Tunisian Arabic (ar_TN) has been added as a supported locale, expanding the internationalization capabilities of the intl package.
  • Comprehensive Localization Data: Full date symbols, date/time patterns, and number formatting symbols specific to ar_TN have been integrated, ensuring accurate cultural representation.
  • Plural Rules Integration: The ar_TN locale now correctly applies Arabic pluralization rules, which are essential for grammatically correct localized text.
  • Enhanced Test Coverage: New test data for number and compact number formatting has been included for ar_TN, verifying the correctness of the newly added localization features.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a 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!

Comment on lines +494 to +587
"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 ألف"],
],

Choose a reason for hiding this comment

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

critical

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'),

Choose a reason for hiding this comment

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

high

The DEF_CURRENCY_CODE should be the ISO 4217 code. For the Tunisian Dinar, the correct code is TND, not DT.

      DEF_CURRENCY_CODE: 'TND'),

WEEKENDRANGE: const [4, 5],
FIRSTWEEKCUTOFFDAY: 4),
// Date/time formatting symbols for locale ar_TN.
"ar_TN": new DateSymbols(

Choose a reason for hiding this comment

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

medium

According to the Effective Dart style guide, the new keyword is unnecessary and should be avoided.1 Please remove it.

      "ar_TN": DateSymbols(

Style Guide References

Footnotes

  1. Effective Dart recommends avoiding the new keyword for constructors.

CURRENCY_PATTERN: '\u200F#,##0.00\u00A0\u00A4',
DEF_CURRENCY_CODE: 'EGP'),
// Number formatting symbols for locale ar_TN.
"ar_TN": new NumberSymbols(

Choose a reason for hiding this comment

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

medium

The new keyword is unnecessary here and should be removed to follow Effective Dart style guidelines.1

  "ar_TN": NumberSymbols(

Style Guide References

Footnotes

  1. Effective Dart recommends avoiding the new keyword for constructors.

@mosuem
Copy link
Member

mosuem commented Sep 22, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants