Fix date localization missing ZERODIGIT in Arabic(ar)#188473
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to override date symbols during localization generation, specifically adding an override for the Arabic ('ar') locale to preserve its historical zero digit ('٠'). It also includes the regenerated date localizations and a regression test to verify that Arabic date formatting behaves correctly. There are no review comments, and I have no feedback to provide.
ac2a868 to
20d9b28
Compare
|
This should be ok to land since it does not directly change the Material library. 👍 |
Piinks
left a comment
There was a problem hiding this comment.
The override uses putIfAbsent, so an upstream fix will take precedence once available.
NICE!
LGTM
|
The google testing failures are all related to the numbers not translated correctly. I'll set Github status and mark it as expected. |
The problem was that I copied in a newer change (flutter/flutter#188473) when I copied in the localizations stuff. So I got the test changes from that PR, but not the code change to make the tests pass. In the future, this PR will come in when we upgrade the SDK for material_ui and cupertino_ui.
flutter/flutter's flutter_localization package that relates to material_ui and cupertino_ui. Moves the code to the right place, makes sure it operates on the correct directories and works correctly and passes CI, and rewords docs and READMEs to reflect the changes. * Creates a *_ui/lib/src/l10n directory. * Moves dart classes into material_ui and cupertino_ui. * Moves the arb files into material_ui and cupertino_ui. * Moves the *_ui l10n tests and makes sure they pass. * Moves the localization scripts to script/l10n and updates them to work in their new location. * Moves READMEs and rewords them, and creates a new README for the scripts. * Updates the license headers to match flutter/packages. * Removed some tests that shouldn't come in until flutter/flutter#188473 is ported to flutter/packages. * Skips some tests that failed on web that were previously not run on the web at all.
Fixes the tree. `flutter_localizations` contains a patch from flutter/flutter#188473 that has not reached stable yet. This means this test needs to accommodate a different result when tested on stable versus master. Refactored to green the tree. @justinmc is filing a follow up issue and looking into extending the code freeze that did not originally apply to localizations. ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Fixes #187767
The date localization data update removed
ZERODIGITfrom Flutter's generated generic Arabic (ar)DateSymbols, which causedDateFormatto fall back to ASCII digits for Arabic date formatting.The upstream
package:intldata change came from dart-lang/i18n commit dart-lang/i18n@4d96553, which removed"ZERODIGIT":"٠"frompkgs/intl/lib/src/data/dates/symbols/ar.json.This PR is to add narrow Flutter-side compatibility override in
gen_date_localizations.dartto preserve Flutter's historical generic ArabicDateFormatbehavior until the upstreamintldata is fixed. The override usesputIfAbsent, so an upstream fix will take precedence once available.Pre-launch Checklist
///).