From 70c2524d29e4507fd66c810a84c8b74b85be1db2 Mon Sep 17 00:00:00 2001 From: Yuval Feinstein Date: Tue, 30 Nov 2021 11:39:03 +0200 Subject: [PATCH 1/3] Add Hebrew(he) locale --- pendulum/locales/he/__init__.py | 0 pendulum/locales/he/custom.py | 9 ++ pendulum/locales/he/locale.py | 263 ++++++++++++++++++++++++++++++++ 3 files changed, 272 insertions(+) create mode 100644 pendulum/locales/he/__init__.py create mode 100644 pendulum/locales/he/custom.py create mode 100644 pendulum/locales/he/locale.py diff --git a/pendulum/locales/he/__init__.py b/pendulum/locales/he/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pendulum/locales/he/custom.py b/pendulum/locales/he/custom.py new file mode 100644 index 00000000..950fdded --- /dev/null +++ b/pendulum/locales/he/custom.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + + +""" +he custom locale file. +""" + +translations = {} diff --git a/pendulum/locales/he/locale.py b/pendulum/locales/he/locale.py new file mode 100644 index 00000000..d341b3f7 --- /dev/null +++ b/pendulum/locales/he/locale.py @@ -0,0 +1,263 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from .custom import translations as custom_translations + + +""" +he locale file. + +It has been generated automatically and must not be modified directly. +""" + + +locale = { + 'plural': lambda n: 'many' if (((0 == 0 and ((0 == 0))) and (not (n == n and ((n >= 0 and n <= 10))))) and ((n % 10) == (n % 10) and (((n % 10) == 0)))) else 'one' if ((n == n and ((n == 1))) and (0 == 0 and ((0 == 0)))) else 'two' if ((n == n and ((n == 2))) and (0 == 0 and ((0 == 0)))) else 'other', + '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: '1', + 2: '2', + 3: '3', + 4: '4', + 5: '5', + 6: '6', + 7: '7', + 8: '8', + 9: '9', + 10: '10', + 11: '11', + 12: '12', + }, + 'wide': { + 1: 'ינואר', + 2: 'פברואר', + 3: 'מרץ', + 4: 'אפריל', + 5: 'מאי', + 6: 'יוני', + 7: 'יולי', + 8: 'אוגוסט', + 9: 'ספטמבר', + 10: 'אוקטובר', + 11: 'נובמבר', + 12: 'דצמבר', + }, + }, + 'units': { + 'year': { + 'one': 'שנה', + 'two': 'שנתיים', + 'many': '{0} שנים', + 'other': '{0} שנים', + }, + 'month': { + 'one': 'חודש', + 'two': 'חודשיים', + 'many': '{0} חודשים', + 'other': '{0} חודשים', + }, + 'week': { + 'one': 'שבוע', + 'two': 'שבועיים', + 'many': '{0} שבועות', + 'other': '{0} שבועות', + }, + 'day': { + 'one': 'יום {0}', + 'two': 'יומיים', + 'many': '{0} יום', + 'other': '{0} ימים', + }, + 'hour': { + 'one': 'שעה', + 'two': 'שעתיים', + 'many': '{0} שעות', + 'other': '{0} שעות', + }, + 'minute': { + 'one': 'דקה', + 'two': 'שתי דקות', + 'many': '{0} דקות', + 'other': '{0} דקות', + }, + 'second': { + 'one': 'שניה', + 'two': 'שתי שניות', + 'many': '\u200f{0} שניות', + 'other': '{0} שניות', + }, + 'microsecond': { + 'one': '{0} מיליונית שנייה', + 'two': '{0} מיליוניות שנייה', + 'many': '{0} מיליוניות שנייה', + 'other': '{0} מיליוניות שנייה', + }, + }, + 'relative': { + 'year': { + 'future': { + 'other': 'בעוד {0} שנים', + 'one': 'בעוד שנה', + 'two': 'בעוד שנתיים', + 'many': 'בעוד {0} שנה', + }, + 'past': { + 'other': 'לפני {0} שנים', + 'one': 'לפני שנה', + 'two': 'לפני שנתיים', + 'many': 'לפני {0} שנה', + }, + }, + 'month': { + 'future': { + 'other': 'בעוד {0} חודשים', + 'one': 'בעוד חודש', + 'two': 'בעוד חודשיים', + 'many': 'בעוד {0} חודשים', + }, + 'past': { + 'other': 'לפני {0} חודשים', + 'one': 'לפני חודש', + 'two': 'לפני חודשיים', + 'many': 'לפני {0} חודשים', + }, + }, + 'week': { + 'future': { + 'other': 'בעוד {0} שבועות', + 'one': 'בעוד שבוע', + 'two': 'בעוד שבועיים', + 'many': 'בעוד {0} שבועות', + }, + 'past': { + 'other': 'לפני {0} שבועות', + 'one': 'לפני שבוע', + 'two': 'לפני שבועיים', + 'many': 'לפני {0} שבועות', + }, + }, + 'day': { + 'future': { + 'other': 'בעוד {0} ימים', + 'one': 'בעוד יום {0}', + 'two': 'בעוד יומיים', + 'many': 'בעוד {0} ימים', + }, + 'past': { + 'other': 'לפני {0} ימים', + 'one': 'לפני יום {0}', + 'two': 'לפני יומיים', + 'many': 'לפני {0} ימים', + }, + }, + 'hour': { + 'future': { + 'other': 'בעוד {0} שעות', + 'one': 'בעוד שעה', + 'two': 'בעוד שעתיים', + 'many': 'בעוד {0} שעות', + }, + 'past': { + 'other': 'לפני {0} שעות', + 'one': 'לפני שעה', + 'two': 'לפני שעתיים', + 'many': 'לפני {0} שעות', + }, + }, + 'minute': { + 'future': { + 'other': 'בעוד {0} דקות', + 'one': 'בעוד דקה', + 'two': 'בעוד שתי דקות', + 'many': 'בעוד {0} דקות', + }, + 'past': { + 'other': 'לפני {0} דקות', + 'one': 'לפני דקה', + 'two': 'לפני שתי דקות', + 'many': 'לפני {0} דקות', + }, + }, + 'second': { + 'future': { + 'other': 'בעוד {0} שניות', + 'one': 'בעוד שנייה', + 'two': 'בעוד שתי שניות', + 'many': 'בעוד {0} שניות', + }, + 'past': { + 'other': 'לפני {0} שניות', + 'one': 'לפני שנייה', + 'two': 'לפני שתי שניות', + 'many': 'לפני {0} שניות', + }, + }, + }, + 'day_periods': { + 'midnight': 'חצות', + 'am': 'לפנה״צ', + 'pm': 'אחה״צ', + 'morning1': 'בבוקר', + 'afternoon1': 'בצהריים', + 'afternoon2': 'אחר הצהריים', + 'evening1': 'בערב', + 'night1': 'בלילה', + 'night2': 'לפנות בוקר', + }, + }, + 'custom': custom_translations +} From 2777073e37eb9fb47cb3f5d10db9e6bde5900a91 Mon Sep 17 00:00:00 2001 From: Yuval Feinstein Date: Wed, 1 Dec 2021 16:12:31 +0200 Subject: [PATCH 2/3] Hebrew (he) localization tests and customization --- pendulum/locales/he/custom.py | 20 ++++++++++- tests/localization/test_he.py | 67 +++++++++++++++++++++++++++++++++++ 2 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 tests/localization/test_he.py diff --git a/pendulum/locales/he/custom.py b/pendulum/locales/he/custom.py index 950fdded..5de79831 100644 --- a/pendulum/locales/he/custom.py +++ b/pendulum/locales/he/custom.py @@ -6,4 +6,22 @@ he custom locale file. """ -translations = {} +translations = { + "units": {"few_second": "כמה שניות"}, + # Relative time + "ago": "לפני {0}", + "from_now": "תוך {0}", + "after": "בעוד {0}", + "before": "{0} קודם", + # Ordinals + "ordinal": {"other": "º"}, + # Date formats + "date_formats": { + "LTS": "H:mm:ss", + "LT": "H:mm", + "LLLL": "dddd, D [ב] MMMM [ב] YYYY H:mm", + "LLL": "D [ב] MMMM [ב] YYYY H:mm", + "LL": "D [ב] MMMM [ב] YYYY", + "L": "DD/MM/YYYY", + }, +} diff --git a/tests/localization/test_he.py b/tests/localization/test_he.py new file mode 100644 index 00000000..cd67a090 --- /dev/null +++ b/tests/localization/test_he.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +import pendulum + + +locale = "he" + + +def test_diff_for_humans(): + with pendulum.test(pendulum.datetime(2016, 8, 29)): + diff_for_humans() + + +def diff_for_humans(): + d = pendulum.now().subtract(seconds=1) + assert d.diff_for_humans(locale=locale) == "לפני כמה שניות" + + d = pendulum.now().subtract(seconds=2) + assert d.diff_for_humans(locale=locale) == "לפני כמה שניות" + + d = pendulum.now().subtract(minutes=1) + assert d.diff_for_humans(locale=locale) == "לפני דקה" + + d = pendulum.now().subtract(minutes=2) + assert d.diff_for_humans(locale=locale) == "לפני שתי דקות" + + d = pendulum.now().subtract(hours=1) + assert d.diff_for_humans(locale=locale) == "לפני שעה" + + d = pendulum.now().subtract(hours=2) + assert d.diff_for_humans(locale=locale) == "לפני שעתיים" + + d = pendulum.now().subtract(days=1) + assert d.diff_for_humans(locale=locale) == "לפני יום 1" + + d = pendulum.now().subtract(days=2) + assert d.diff_for_humans(locale=locale) == "לפני יומיים" + + d = pendulum.now().subtract(weeks=1) + assert d.diff_for_humans(locale=locale) == "לפני שבוע" + + d = pendulum.now().subtract(weeks=2) + assert d.diff_for_humans(locale=locale) == "לפני שבועיים" + + d = pendulum.now().subtract(months=1) + assert d.diff_for_humans(locale=locale) == "לפני חודש" + + d = pendulum.now().subtract(months=2) + assert d.diff_for_humans(locale=locale) == "לפני חודשיים" + + d = pendulum.now().subtract(years=1) + assert d.diff_for_humans(locale=locale) == "לפני שנה" + + d = pendulum.now().subtract(years=2) + assert d.diff_for_humans(locale=locale) == "לפני שנתיים" + + d = pendulum.now().add(seconds=1) + assert d.diff_for_humans(locale=locale) == "תוך כמה שניות" + + d = pendulum.now().add(seconds=1) + d2 = pendulum.now() + assert d.diff_for_humans(d2, locale=locale) == "בעוד כמה שניות" + assert d2.diff_for_humans(d, locale=locale) == "כמה שניות קודם" + + assert d.diff_for_humans(d2, True, locale=locale) == "כמה שניות" + assert d2.diff_for_humans(d.add(seconds=1), True, locale=locale) == "כמה שניות" From f9e1cd8126928a4e69f41479c358859f12a55563 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 7 Aug 2022 14:47:04 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pendulum/locales/he/custom.py | 4 - pendulum/locales/he/locale.py | 424 +++++++++++++++++----------------- tests/localization/test_he.py | 3 +- 3 files changed, 216 insertions(+), 215 deletions(-) diff --git a/pendulum/locales/he/custom.py b/pendulum/locales/he/custom.py index 5de79831..51f84769 100644 --- a/pendulum/locales/he/custom.py +++ b/pendulum/locales/he/custom.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - - """ he custom locale file. """ diff --git a/pendulum/locales/he/locale.py b/pendulum/locales/he/locale.py index d341b3f7..457c1019 100644 --- a/pendulum/locales/he/locale.py +++ b/pendulum/locales/he/locale.py @@ -1,6 +1,3 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - from .custom import translations as custom_translations @@ -12,252 +9,261 @@ locale = { - 'plural': lambda n: 'many' if (((0 == 0 and ((0 == 0))) and (not (n == n and ((n >= 0 and n <= 10))))) and ((n % 10) == (n % 10) and (((n % 10) == 0)))) else 'one' if ((n == n and ((n == 1))) and (0 == 0 and ((0 == 0)))) else 'two' if ((n == n and ((n == 2))) and (0 == 0 and ((0 == 0)))) else 'other', - 'ordinal': lambda n: 'other', - 'translations': { - 'days': { - 'abbreviated': { - 0: 'יום א׳', - 1: 'יום ב׳', - 2: 'יום ג׳', - 3: 'יום ד׳', - 4: 'יום ה׳', - 5: 'יום ו׳', - 6: 'שבת', + "plural": lambda n: "many" + if ( + ((0 == 0 and (0 == 0)) and (not (n == n and (n >= 0 and n <= 10)))) + and ((n % 10) == (n % 10) and ((n % 10) == 0)) + ) + else "one" + if ((n == n and (n == 1)) and (0 == 0 and (0 == 0))) + else "two" + if ((n == n and (n == 2)) and (0 == 0 and (0 == 0))) + else "other", + "ordinal": lambda n: "other", + "translations": { + "days": { + "abbreviated": { + 0: "יום א׳", + 1: "יום ב׳", + 2: "יום ג׳", + 3: "יום ד׳", + 4: "יום ה׳", + 5: "יום ו׳", + 6: "שבת", }, - 'narrow': { - 0: 'א׳', - 1: 'ב׳', - 2: 'ג׳', - 3: 'ד׳', - 4: 'ה׳', - 5: 'ו׳', - 6: 'ש׳', + "narrow": { + 0: "א׳", + 1: "ב׳", + 2: "ג׳", + 3: "ד׳", + 4: "ה׳", + 5: "ו׳", + 6: "ש׳", }, - 'short': { - 0: 'א׳', - 1: 'ב׳', - 2: 'ג׳', - 3: 'ד׳', - 4: 'ה׳', - 5: 'ו׳', - 6: 'ש׳', + "short": { + 0: "א׳", + 1: "ב׳", + 2: "ג׳", + 3: "ד׳", + 4: "ה׳", + 5: "ו׳", + 6: "ש׳", }, - 'wide': { - 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: 'דצמ׳', + "months": { + "abbreviated": { + 1: "ינו׳", + 2: "פבר׳", + 3: "מרץ", + 4: "אפר׳", + 5: "מאי", + 6: "יוני", + 7: "יולי", + 8: "אוג׳", + 9: "ספט׳", + 10: "אוק׳", + 11: "נוב׳", + 12: "דצמ׳", }, - 'narrow': { - 1: '1', - 2: '2', - 3: '3', - 4: '4', - 5: '5', - 6: '6', - 7: '7', - 8: '8', - 9: '9', - 10: '10', - 11: '11', - 12: '12', + "narrow": { + 1: "1", + 2: "2", + 3: "3", + 4: "4", + 5: "5", + 6: "6", + 7: "7", + 8: "8", + 9: "9", + 10: "10", + 11: "11", + 12: "12", }, - 'wide': { - 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': { - 'one': 'שנה', - 'two': 'שנתיים', - 'many': '{0} שנים', - 'other': '{0} שנים', + "units": { + "year": { + "one": "שנה", + "two": "שנתיים", + "many": "{0} שנים", + "other": "{0} שנים", }, - 'month': { - 'one': 'חודש', - 'two': 'חודשיים', - 'many': '{0} חודשים', - 'other': '{0} חודשים', + "month": { + "one": "חודש", + "two": "חודשיים", + "many": "{0} חודשים", + "other": "{0} חודשים", }, - 'week': { - 'one': 'שבוע', - 'two': 'שבועיים', - 'many': '{0} שבועות', - 'other': '{0} שבועות', + "week": { + "one": "שבוע", + "two": "שבועיים", + "many": "{0} שבועות", + "other": "{0} שבועות", }, - 'day': { - 'one': 'יום {0}', - 'two': 'יומיים', - 'many': '{0} יום', - 'other': '{0} ימים', + "day": { + "one": "יום {0}", + "two": "יומיים", + "many": "{0} יום", + "other": "{0} ימים", }, - 'hour': { - 'one': 'שעה', - 'two': 'שעתיים', - 'many': '{0} שעות', - 'other': '{0} שעות', + "hour": { + "one": "שעה", + "two": "שעתיים", + "many": "{0} שעות", + "other": "{0} שעות", }, - 'minute': { - 'one': 'דקה', - 'two': 'שתי דקות', - 'many': '{0} דקות', - 'other': '{0} דקות', + "minute": { + "one": "דקה", + "two": "שתי דקות", + "many": "{0} דקות", + "other": "{0} דקות", }, - 'second': { - 'one': 'שניה', - 'two': 'שתי שניות', - 'many': '\u200f{0} שניות', - 'other': '{0} שניות', + "second": { + "one": "שניה", + "two": "שתי שניות", + "many": "\u200f{0} שניות", + "other": "{0} שניות", }, - 'microsecond': { - 'one': '{0} מיליונית שנייה', - 'two': '{0} מיליוניות שנייה', - 'many': '{0} מיליוניות שנייה', - 'other': '{0} מיליוניות שנייה', + "microsecond": { + "one": "{0} מיליונית שנייה", + "two": "{0} מיליוניות שנייה", + "many": "{0} מיליוניות שנייה", + "other": "{0} מיליוניות שנייה", }, }, - 'relative': { - 'year': { - 'future': { - 'other': 'בעוד {0} שנים', - 'one': 'בעוד שנה', - 'two': 'בעוד שנתיים', - 'many': 'בעוד {0} שנה', + "relative": { + "year": { + "future": { + "other": "בעוד {0} שנים", + "one": "בעוד שנה", + "two": "בעוד שנתיים", + "many": "בעוד {0} שנה", }, - 'past': { - 'other': 'לפני {0} שנים', - 'one': 'לפני שנה', - 'two': 'לפני שנתיים', - 'many': 'לפני {0} שנה', + "past": { + "other": "לפני {0} שנים", + "one": "לפני שנה", + "two": "לפני שנתיים", + "many": "לפני {0} שנה", }, }, - 'month': { - 'future': { - 'other': 'בעוד {0} חודשים', - 'one': 'בעוד חודש', - 'two': 'בעוד חודשיים', - 'many': 'בעוד {0} חודשים', + "month": { + "future": { + "other": "בעוד {0} חודשים", + "one": "בעוד חודש", + "two": "בעוד חודשיים", + "many": "בעוד {0} חודשים", }, - 'past': { - 'other': 'לפני {0} חודשים', - 'one': 'לפני חודש', - 'two': 'לפני חודשיים', - 'many': 'לפני {0} חודשים', + "past": { + "other": "לפני {0} חודשים", + "one": "לפני חודש", + "two": "לפני חודשיים", + "many": "לפני {0} חודשים", }, }, - 'week': { - 'future': { - 'other': 'בעוד {0} שבועות', - 'one': 'בעוד שבוע', - 'two': 'בעוד שבועיים', - 'many': 'בעוד {0} שבועות', + "week": { + "future": { + "other": "בעוד {0} שבועות", + "one": "בעוד שבוע", + "two": "בעוד שבועיים", + "many": "בעוד {0} שבועות", }, - 'past': { - 'other': 'לפני {0} שבועות', - 'one': 'לפני שבוע', - 'two': 'לפני שבועיים', - 'many': 'לפני {0} שבועות', + "past": { + "other": "לפני {0} שבועות", + "one": "לפני שבוע", + "two": "לפני שבועיים", + "many": "לפני {0} שבועות", }, }, - 'day': { - 'future': { - 'other': 'בעוד {0} ימים', - 'one': 'בעוד יום {0}', - 'two': 'בעוד יומיים', - 'many': 'בעוד {0} ימים', + "day": { + "future": { + "other": "בעוד {0} ימים", + "one": "בעוד יום {0}", + "two": "בעוד יומיים", + "many": "בעוד {0} ימים", }, - 'past': { - 'other': 'לפני {0} ימים', - 'one': 'לפני יום {0}', - 'two': 'לפני יומיים', - 'many': 'לפני {0} ימים', + "past": { + "other": "לפני {0} ימים", + "one": "לפני יום {0}", + "two": "לפני יומיים", + "many": "לפני {0} ימים", }, }, - 'hour': { - 'future': { - 'other': 'בעוד {0} שעות', - 'one': 'בעוד שעה', - 'two': 'בעוד שעתיים', - 'many': 'בעוד {0} שעות', + "hour": { + "future": { + "other": "בעוד {0} שעות", + "one": "בעוד שעה", + "two": "בעוד שעתיים", + "many": "בעוד {0} שעות", }, - 'past': { - 'other': 'לפני {0} שעות', - 'one': 'לפני שעה', - 'two': 'לפני שעתיים', - 'many': 'לפני {0} שעות', + "past": { + "other": "לפני {0} שעות", + "one": "לפני שעה", + "two": "לפני שעתיים", + "many": "לפני {0} שעות", }, }, - 'minute': { - 'future': { - 'other': 'בעוד {0} דקות', - 'one': 'בעוד דקה', - 'two': 'בעוד שתי דקות', - 'many': 'בעוד {0} דקות', + "minute": { + "future": { + "other": "בעוד {0} דקות", + "one": "בעוד דקה", + "two": "בעוד שתי דקות", + "many": "בעוד {0} דקות", }, - 'past': { - 'other': 'לפני {0} דקות', - 'one': 'לפני דקה', - 'two': 'לפני שתי דקות', - 'many': 'לפני {0} דקות', + "past": { + "other": "לפני {0} דקות", + "one": "לפני דקה", + "two": "לפני שתי דקות", + "many": "לפני {0} דקות", }, }, - 'second': { - 'future': { - 'other': 'בעוד {0} שניות', - 'one': 'בעוד שנייה', - 'two': 'בעוד שתי שניות', - 'many': 'בעוד {0} שניות', + "second": { + "future": { + "other": "בעוד {0} שניות", + "one": "בעוד שנייה", + "two": "בעוד שתי שניות", + "many": "בעוד {0} שניות", }, - 'past': { - 'other': 'לפני {0} שניות', - 'one': 'לפני שנייה', - 'two': 'לפני שתי שניות', - 'many': 'לפני {0} שניות', + "past": { + "other": "לפני {0} שניות", + "one": "לפני שנייה", + "two": "לפני שתי שניות", + "many": "לפני {0} שניות", }, }, }, - 'day_periods': { - 'midnight': 'חצות', - 'am': 'לפנה״צ', - 'pm': 'אחה״צ', - 'morning1': 'בבוקר', - 'afternoon1': 'בצהריים', - 'afternoon2': 'אחר הצהריים', - 'evening1': 'בערב', - 'night1': 'בלילה', - 'night2': 'לפנות בוקר', + "day_periods": { + "midnight": "חצות", + "am": "לפנה״צ", + "pm": "אחה״צ", + "morning1": "בבוקר", + "afternoon1": "בצהריים", + "afternoon2": "אחר הצהריים", + "evening1": "בערב", + "night1": "בלילה", + "night2": "לפנות בוקר", }, }, - 'custom': custom_translations + "custom": custom_translations, } diff --git a/tests/localization/test_he.py b/tests/localization/test_he.py index cd67a090..53adfd20 100644 --- a/tests/localization/test_he.py +++ b/tests/localization/test_he.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals +from __future__ import annotations import pendulum