Add Arabic / ar localization#184
Merged
Merged
Conversation
barq-al-layl
commented
Jun 10, 2026
Contributor
- related issue: Create translation for Arabic language #67
- Add dual forms for all time units in Arabic strings. - Update duration formatting logic to remove numeric prefixes for quantities 1 and 2 in Arabic. - Update tests to reflect localized Arabic time unit formatting.
There was a problem hiding this comment.
Pull request overview
Adds Arabic (ar) localization support to the Human-Readable formatting utilities, including Arabic pluralization rules and translated units so duration, timeAgo, distance, and fileSize can produce Arabic output.
Changes:
- Added Arabic Libres string resources for time units, distance units, and data units.
- Added Arabic plural rules for Apple & JS and added Arabic smoke tests.
- Updated core duration formatting to omit the numeric prefix for Arabic dual/singular forms, plus README and demo language list updates.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/commonTest/kotlin/nl/jacobras/humanreadable/localized/LocalizedTests.kt | Adds Arabic smoke tests for duration/timeAgo/number/fileSize/abbreviation/distance. |
| src/commonMain/libres/strings/time_units_ar.xml | Adds Arabic time unit plurals and relative-time strings. |
| src/commonMain/libres/strings/distance_units_ar.xml | Adds Arabic distance unit abbreviations. |
| src/commonMain/libres/strings/data_units_ar.xml | Adds Arabic data unit symbols for file size formatting. |
| src/commonMain/kotlin/nl/jacobras/humanreadable/HumanReadableDuration.kt | Adds Arabic-specific handling to drop leading “1 ” / “2 ” from formatted durations. |
| src/appleAndJsMain/kotlin/nl/jacobras/humanreadable/extendLibresPlurals.kt | Adds Arabic plural rule implementation for Apple & JS targets. |
| README.md | Lists Arabic among supported languages. |
| demo/src/webMain/kotlin/Language.kt | Adds Arabic to the demo language selector enum. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Owner
|
Thanks! This will be in 1.13.0 |
Owner
Contributor
Author
|
Many thanks! |
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.