Skip to content

Add Arabic / ar localization#184

Merged
jacobras merged 5 commits into
jacobras:mainfrom
barq-al-layl:feat/arabic-support
Jun 19, 2026
Merged

Add Arabic / ar localization#184
jacobras merged 5 commits into
jacobras:mainfrom
barq-al-layl:feat/arabic-support

Conversation

@barq-al-layl

Copy link
Copy Markdown
Contributor

- 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread src/commonTest/kotlin/nl/jacobras/humanreadable/localized/LocalizedTests.kt Outdated
Comment thread src/commonMain/kotlin/nl/jacobras/humanreadable/HumanReadableDuration.kt Outdated
@jacobras jacobras merged commit b6f10a1 into jacobras:main Jun 19, 2026
1 check failed
@jacobras

Copy link
Copy Markdown
Owner

Thanks! This will be in 1.13.0

@jacobras jacobras added this to the 1.13.0 milestone Jun 20, 2026
@jacobras

Copy link
Copy Markdown
Owner

Released: https://github.com/jacobras/Human-Readable/releases/tag/1.13.0

@barq-al-layl

Copy link
Copy Markdown
Contributor Author

Many thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants