Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'week' and 'weeks' to Arabic locale #1155

Merged
merged 2 commits into from Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions arrow/locales.py
Expand Up @@ -2547,6 +2547,8 @@ class ArabicLocale(Locale):
"hours": {"2": "ساعتين", "ten": "{0} ساعات", "higher": "{0} ساعة"},
"day": "يوم",
"days": {"2": "يومين", "ten": "{0} أيام", "higher": "{0} يوم"},
"week": "اسبوع",
"weeks": {"2": "اسبوعين", "ten": "{0} أسابيع", "higher": "{0} اسبوع"},
"month": "شهر",
"months": {"2": "شهرين", "ten": "{0} أشهر", "higher": "{0} شهر"},
"year": "سنة",
Expand Down
4 changes: 4 additions & 0 deletions tests/test_locales.py
Expand Up @@ -1414,26 +1414,30 @@ def test_timeframes(self):
assert self.locale._format_timeframe("minute", 1) == "دقيقة"
assert self.locale._format_timeframe("hour", 1) == "ساعة"
assert self.locale._format_timeframe("day", 1) == "يوم"
assert self.locale._format_timeframe("week", 1) == "اسبوع"
assert self.locale._format_timeframe("month", 1) == "شهر"
assert self.locale._format_timeframe("year", 1) == "سنة"

# double
assert self.locale._format_timeframe("minutes", 2) == "دقيقتين"
assert self.locale._format_timeframe("hours", 2) == "ساعتين"
assert self.locale._format_timeframe("days", 2) == "يومين"
assert self.locale._format_timeframe("weeks", 2) == "اسبوعين"
assert self.locale._format_timeframe("months", 2) == "شهرين"
assert self.locale._format_timeframe("years", 2) == "سنتين"

# up to ten
assert self.locale._format_timeframe("minutes", 3) == "3 دقائق"
assert self.locale._format_timeframe("hours", 4) == "4 ساعات"
assert self.locale._format_timeframe("days", 5) == "5 أيام"
assert self.locale._format_timeframe("weeks", 7) == "7 أسابيع"
assert self.locale._format_timeframe("months", 6) == "6 أشهر"
assert self.locale._format_timeframe("years", 10) == "10 سنوات"

# more than ten
assert self.locale._format_timeframe("minutes", 11) == "11 دقيقة"
assert self.locale._format_timeframe("hours", 19) == "19 ساعة"
assert self.locale._format_timeframe("weeks", 20) == "20 اسبوع"
assert self.locale._format_timeframe("months", 24) == "24 شهر"
assert self.locale._format_timeframe("days", 50) == "50 يوم"
assert self.locale._format_timeframe("years", 115) == "115 سنة"
Expand Down