Skip to content

Add Arabic (ar) translation - #231

Merged
bradymholt merged 2 commits into
bradymholt:masterfrom
MohamedAhmedEz:feat/i18n-arabic
Dec 3, 2026
Merged

bradymholt merged 2 commits into
bradymholt:masterfrom
MohamedAhmedEz:feat/i18n-arabic

Conversation

@MohamedAhmedEz

Copy link
Copy Markdown
Contributor

Notes for review

  • Separators: Shared code hardcodes ", " and "," for list joins, and TransformVerbosity matches CommaEveryHour and CommaEveryMinute. The Arabic resources for those keys use ASCII , to keep verbose stripping working, so some output mixes , and ،. A localized list-separator resource would fix this. Happy to follow up if wanted.
  • Plurals (Arabic-specific): Arabic nouns change form by count, but interval phrases such as every {0} hours use the singular noun for every number. The output is clear to readers but not fully grammatical. This is a known limitation of the current structure for Arabic, and tests for those phrases are omitted.

Checklist

  • dotnet test test/Test.csproj passes
  • Added or updated tests for the change
  • For a new language: added it to the README table, the demo language list and the csproj

@bradymholt bradymholt left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The resource file covers every key and the placeholders line up. Two more Comma* keys need the ASCII , for the same reason as CommaEveryHour/CommaEveryMinute: GetSegmentDescription strips or checks ", " for ranges inside lists and for stepped ranges. Could you switch those two and add a test for * * * 1-3,6 * and * * 1-10/3 * *?

Comment thread lib/Resources.ar.resx Outdated
<comment>EveryX0DaysOfTheWeek description</comment>
</data>
<data name="CommaX0ThroughX1" xml:space="preserve">
<value>، من {0} إلى {1}</value>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

GetSegmentDescription removes the leading comma from this string with .Replace(", ", "") and StartsWith(", "), so ، stays in. * * * 1-3,6 * gives كل دقيقة، فقط في ، من يناير إلى مارس و يونيو. The PR says only CommaEveryHour/CommaEveryMinute need ASCII. Should this key use , too?

Comment thread lib/Resources.ar.resx Outdated
<comment>CommaEveryX0Days description</comment>
</data>
<data name="CommaBetweenDayX0AndX1OfTheMonth" xml:space="preserve">
<value>، من اليوم {0} إلى {1} من الشهر</value>

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The StartsWith(", ") check in GetSegmentDescription fails for this key, so * * 1-10/3 * * gives كل دقيقة، كل 3 يوم, ، من اليوم 1 إلى 10 من الشهر with a doubled comma. I think an ASCII , prefix here plus a test for a stepped day range would cover it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review and the clear pointers on GetSegmentDescription!

I've updated both CommaX0ThroughX1 and CommaBetweenDayX0AndX1OfTheMonth in lib/Resources.ar.resx to use an ASCII , prefix, aligned the Arabic phrasing/grammar with the ports implementations, and added tests for * * * 1-3,6 * and * * 1-10/3 * * in test/TestFormats.ar.cs.

dotnet test test/Test.csproj passes locally. Ready for another look whenever you have time!

@bradymholt
bradymholt enabled auto-merge (squash) December 3, 2026 17:08
@bradymholt
bradymholt merged commit fc98257 into bradymholt:master Dec 3, 2026
3 checks passed
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

The changes in PR were just released in 3.8.0 🎉.

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.

2 participants