Repository navigation
Conversation
Adds src/pendulum/locales/ar with Modern Standard Arabic names, relative and duration phrases, day periods and date formats, plus a six-form plural rule (zero, one, two, few, many, other) following the CLDR Arabic rules. Tests cover diff_for_humans, in_words, format and the plural forms. Signed-off-by: Moamen Abdulraouf Mansour <moamen.ui@gmail.com>
moamen-ui
added a commit
to moamen-ui/taareeb
that referenced
this pull request
Dec 5, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an Arabic (
ar) locale undersrc/pendulum/locales/ar/, following the most recent additions (guin #963,hiin #902): same file layout, samelocale/customstructure, and a test module intests/localization/test_ar.py.What is in it:
منذfor past,خلالfor future), andبعد/قبلfor comparisons between two dates, plus "بضع ثوانٍ" for a few seconds.ar-EG. Tell me if you prefer the Sunday-firstar-SAconvention.Not included:
ordinalreturnsotherand nocustom.ordinalis set (same asguandhi).ar-SAorar_EGraiseLocale [ar_sa] does not exist., the same as the existinghe-ILandde-CH. This is pre-existing loader behaviour and is not changed here.Output samples (real runs on this branch, Python 3.12, pure-Python path):
An AI tool helped with the locale data and the tests, and a second AI review of the Arabic strings found two wording issues (narrow month letters and the "few" form of microseconds), which were fixed. I am an Arabic speaker, but a native review is welcome, especially for the unit phrases and the plural forms.
Checks:
pytest tests(1873 passed; the new locale tests pass),ruff checkandruff format --checkon the new files,mypy(strict, full project, 232 files).tests/test_main.py::test_instance_with_aware_datetime_any_tzinfofails on an unmodifiedmasterin this environment (timezone-dependent,Europe/Parisvs+02:00). It is not touched by this PR.Not run or not verified:
This PR is part of Taareeb, an open project for Arabic localization of open source software: https://github.com/moamen-ui/taareeb