Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
24 changes: 24 additions & 0 deletions src/pendulum/locales/ar/custom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
ar custom locale file.
"""

from __future__ import annotations


translations = {
"units": {"few_second": "بضع ثوانٍ"},
# Relative time
"ago": "منذ {0}",
"from_now": "خلال {0}",
"after": "بعد {0}",
"before": "قبل {0}",
# Date formats
"date_formats": {
"LTS": "h:mm:ss A",
"LT": "h:mm A",
"L": "DD/MM/YYYY",
"LL": "D MMMM YYYY",
"LLL": "D MMMM YYYY، h:mm A",
"LLLL": "dddd، D MMMM YYYY، h:mm A",
},
}
329 changes: 329 additions & 0 deletions src/pendulum/locales/ar/locale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,329 @@
from __future__ import annotations

from pendulum.locales.ar.custom import translations as custom_translations


"""
ar locale file.

Arabic (Modern Standard Arabic). Month and weekday names and the day periods
follow CLDR data; the duration and relative phrases are written in MSA.
"""


def _plural(n: int) -> str:
"""
CLDR plural rules for Arabic (integers): zero, one, two, few, many, other.
"""
if n == 0:
return "zero"
if n == 1:
return "one"
if n == 2:
return "two"
if 3 <= n % 100 <= 10:
return "few"
if 11 <= n % 100 <= 99:
return "many"
return "other"


locale = {
"plural": _plural,
"ordinal": lambda n: "other",
"translations": {
"days": {
"abbreviated": {
0: "الاثنين",
1: "الثلاثاء",
2: "الأربعاء",
3: "الخميس",
4: "الجمعة",
5: "السبت",
6: "الأحد",
},
"narrow": {
0: "ن",
1: "ث",
2: "ر",
3: "خ",
4: "ج",
5: "س",
6: "ح",
},
"short": {
0: "إثنين",
1: "ثلاثاء",
2: "أربعاء",
3: "خميس",
4: "جمعة",
5: "سبت",
6: "أحد",
},
"wide": {
0: "الاثنين",
1: "الثلاثاء",
2: "الأربعاء",
3: "الخميس",
4: "الجمعة",
5: "السبت",
6: "الأحد",
},
},
"months": {
"abbreviated": {
1: "يناير",
2: "فبراير",
3: "مارس",
4: "أبريل",
5: "مايو",
6: "يونيو",
7: "يوليو",
8: "أغسطس",
9: "سبتمبر",
10: "أكتوبر",
11: "نوفمبر",
12: "ديسمبر",
},
"narrow": {
1: "ي",
2: "ف",
3: "م",
4: "أ",
5: "م",
6: "ي",
7: "ي",
8: "أ",
9: "س",
10: "أ",
11: "ن",
12: "د",
},
"wide": {
1: "يناير",
2: "فبراير",
3: "مارس",
4: "أبريل",
5: "مايو",
6: "يونيو",
7: "يوليو",
8: "أغسطس",
9: "سبتمبر",
10: "أكتوبر",
11: "نوفمبر",
12: "ديسمبر",
},
},
"units": {
"year": {
"zero": "{0} سنة",
"one": "سنة",
"two": "سنتان",
"few": "{0} سنوات",
"many": "{0} سنة",
"other": "{0} سنة",
},
"month": {
"zero": "{0} شهر",
"one": "شهر",
"two": "شهران",
"few": "{0} أشهر",
"many": "{0} شهرًا",
"other": "{0} شهر",
},
"week": {
"zero": "{0} أسبوع",
"one": "أسبوع",
"two": "أسبوعان",
"few": "{0} أسابيع",
"many": "{0} أسبوعًا",
"other": "{0} أسبوع",
},
"day": {
"zero": "{0} يوم",
"one": "يوم",
"two": "يومان",
"few": "{0} أيام",
"many": "{0} يومًا",
"other": "{0} يوم",
},
"hour": {
"zero": "{0} ساعة",
"one": "ساعة",
"two": "ساعتان",
"few": "{0} ساعات",
"many": "{0} ساعة",
"other": "{0} ساعة",
},
"minute": {
"zero": "{0} دقيقة",
"one": "دقيقة",
"two": "دقيقتان",
"few": "{0} دقائق",
"many": "{0} دقيقة",
"other": "{0} دقيقة",
},
"second": {
"zero": "{0} ثانية",
"one": "ثانية",
"two": "ثانيتان",
"few": "{0} ثوانٍ",
"many": "{0} ثانية",
"other": "{0} ثانية",
},
"microsecond": {
"zero": "{0} ميكروثانية",
"one": "ميكروثانية",
"two": "ميكروثانيتان",
"few": "{0} ميكروثانيات",
"many": "{0} ميكروثانية",
"other": "{0} ميكروثانية",
},
},
"relative": {
"year": {
"future": {
"zero": "خلال {0} سنة",
"one": "خلال سنة",
"two": "خلال سنتين",
"few": "خلال {0} سنوات",
"many": "خلال {0} سنة",
"other": "خلال {0} سنة",
},
"past": {
"zero": "منذ {0} سنة",
"one": "منذ سنة",
"two": "منذ سنتين",
"few": "منذ {0} سنوات",
"many": "منذ {0} سنة",
"other": "منذ {0} سنة",
},
},
"month": {
"future": {
"zero": "خلال {0} شهر",
"one": "خلال شهر",
"two": "خلال شهرين",
"few": "خلال {0} أشهر",
"many": "خلال {0} شهرًا",
"other": "خلال {0} شهر",
},
"past": {
"zero": "منذ {0} شهر",
"one": "منذ شهر",
"two": "منذ شهرين",
"few": "منذ {0} أشهر",
"many": "منذ {0} شهرًا",
"other": "منذ {0} شهر",
},
},
"week": {
"future": {
"zero": "خلال {0} أسبوع",
"one": "خلال أسبوع",
"two": "خلال أسبوعين",
"few": "خلال {0} أسابيع",
"many": "خلال {0} أسبوعًا",
"other": "خلال {0} أسبوع",
},
"past": {
"zero": "منذ {0} أسبوع",
"one": "منذ أسبوع",
"two": "منذ أسبوعين",
"few": "منذ {0} أسابيع",
"many": "منذ {0} أسبوعًا",
"other": "منذ {0} أسبوع",
},
},
"day": {
"future": {
"zero": "خلال {0} يوم",
"one": "خلال يوم",
"two": "خلال يومين",
"few": "خلال {0} أيام",
"many": "خلال {0} يومًا",
"other": "خلال {0} يوم",
},
"past": {
"zero": "منذ {0} يوم",
"one": "منذ يوم",
"two": "منذ يومين",
"few": "منذ {0} أيام",
"many": "منذ {0} يومًا",
"other": "منذ {0} يوم",
},
},
"hour": {
"future": {
"zero": "خلال {0} ساعة",
"one": "خلال ساعة",
"two": "خلال ساعتين",
"few": "خلال {0} ساعات",
"many": "خلال {0} ساعة",
"other": "خلال {0} ساعة",
},
"past": {
"zero": "منذ {0} ساعة",
"one": "منذ ساعة",
"two": "منذ ساعتين",
"few": "منذ {0} ساعات",
"many": "منذ {0} ساعة",
"other": "منذ {0} ساعة",
},
},
"minute": {
"future": {
"zero": "خلال {0} دقيقة",
"one": "خلال دقيقة",
"two": "خلال دقيقتين",
"few": "خلال {0} دقائق",
"many": "خلال {0} دقيقة",
"other": "خلال {0} دقيقة",
},
"past": {
"zero": "منذ {0} دقيقة",
"one": "منذ دقيقة",
"two": "منذ دقيقتين",
"few": "منذ {0} دقائق",
"many": "منذ {0} دقيقة",
"other": "منذ {0} دقيقة",
},
},
"second": {
"future": {
"zero": "خلال {0} ثانية",
"one": "خلال ثانية",
"two": "خلال ثانيتين",
"few": "خلال {0} ثوانٍ",
"many": "خلال {0} ثانية",
"other": "خلال {0} ثانية",
},
"past": {
"zero": "منذ {0} ثانية",
"one": "منذ ثانية",
"two": "منذ ثانيتين",
"few": "منذ {0} ثوانٍ",
"many": "منذ {0} ثانية",
"other": "منذ {0} ثانية",
},
},
},
"day_periods": {
"midnight": "منتصف الليل",
"am": "ص",
"noon": "الظهر",
"pm": "م",
"morning1": "صباحًا",
"afternoon1": "ظهرًا",
"evening1": "مساءً",
"night1": "ليلاً",
},
"week_data": {
"min_days": 1,
"first_day": 5,
"weekend_start": 4,
"weekend_end": 5,
},
},
"custom": custom_translations,
}
Loading