Repository navigation
Add Arabic (ar) translation - #231
Conversation
bradymholt
left a comment
There was a problem hiding this comment.
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>EveryX0DaysOfTheWeek description</comment> | ||
| </data> | ||
| <data name="CommaX0ThroughX1" xml:space="preserve"> | ||
| <value>، من {0} إلى {1}</value> |
There was a problem hiding this comment.
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>CommaEveryX0Days description</comment> | ||
| </data> | ||
| <data name="CommaBetweenDayX0AndX1OfTheMonth" xml:space="preserve"> | ||
| <value>، من اليوم {0} إلى {1} من الشهر</value> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
|
The changes in PR were just released in 3.8.0 🎉. |
Notes for review
", "and","for list joins, andTransformVerbositymatchesCommaEveryHourandCommaEveryMinute. 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.every {0} hoursuse 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.csprojpasses