File tree Expand file tree Collapse file tree
src/humanize/locale/fa_IR/LC_MESSAGES Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # German translation for humanize.
1+ # Persian translation for humanize.
22# Copyright (C) 2016 THE PACKAGE'S COPYRIGHT HOLDER
33# This file is distributed under the same license as the humanize package.
44# Christian Klein <chris@5711.org>, 2016.
@@ -10,8 +10,8 @@ msgstr ""
1010"POT-Creation-Date : 2023-01-08 19:22+0200\n "
1111"PO-Revision-Date : 2017-01-10 02:44+0330\n "
1212"Last-Translator : Christian Klein <chris@5711.org>\n "
13- "Language-Team : German \n "
14- "Language : de \n "
13+ "Language-Team : Persian \n "
14+ "Language : fa_IR \n "
1515"MIME-Version : 1.0\n "
1616"Content-Type : text/plain; charset=utf-8\n "
1717"Content-Transfer-Encoding : 8bit\n "
@@ -336,7 +336,7 @@ msgstr[1] "%d سال"
336336#: src/humanize/time.py:256
337337#, python-format
338338msgid "%s from now"
339- msgstr "%s تا به اکنون "
339+ msgstr "%s دیگر "
340340
341341#: src/humanize/time.py:256
342342#, python-format
Original file line number Diff line number Diff line change @@ -102,6 +102,27 @@ def test_i18n() -> None:
102102 assert humanize .precisedelta (one_min_three_seconds ) == "1 minute and 7 seconds"
103103
104104
105+ @pytest .mark .parametrize (
106+ "seconds, expected" ,
107+ [
108+ (- 60 , "یک دقیقه پیش" ),
109+ (- 3 , "3 ثانیه پیش" ),
110+ (0 , "اکنون" ),
111+ (3 , "3 ثانیه دیگر" ),
112+ (60 , "یک دقیقه دیگر" ),
113+ ],
114+ )
115+ def test_naturaltime_persian (seconds : int , expected : str ) -> None :
116+ try :
117+ humanize .activate ("fa_IR" )
118+ value = NOW + dt .timedelta (seconds = seconds )
119+ assert humanize .naturaltime (value , when = NOW ) == expected
120+ except FileNotFoundError :
121+ pytest .skip ("Generate .mo with scripts/generate-translation-binaries.sh" )
122+ finally :
123+ humanize .deactivate ()
124+
125+
105126def test_intcomma () -> None :
106127 number = 10_000_000
107128
You can’t perform that action at this time.
0 commit comments