Skip to content

Commit

Permalink
add 'week' and 'weeks' to Arabic locale (#1155)
Browse files Browse the repository at this point in the history
Co-authored-by: Jad Chaar <jadchaar@users.noreply.github.com>
  • Loading branch information
AbdullahAlajmi and jadchaar committed Sep 30, 2023
1 parent 3a6cd95 commit 522a65b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arrow/locales.py
Expand Up @@ -2549,6 +2549,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

0 comments on commit 522a65b

Please sign in to comment.