@@ -6100,3 +6100,174 @@ class KazakhLocale(Locale):
61006100 "ΠΠ΅ΠΊΡΠ΅Π½Π±Ρ" ,
61016101 ]
61026102 day_abbreviations = ["" , "ΠΡ" , "Π‘Ρ" , "Π‘Ρ" , "ΠΡ" , "ΠΠΌ" , "Π‘Π±" , "ΠΡ" ]
6103+
6104+
6105+ class AmharicLocale (Locale ):
6106+ names = ["am" , "am-et" ]
6107+
6108+ past = "{0} α αα΅"
6109+ future = "{0} αα΅α₯"
6110+ and_word = "α₯α"
6111+
6112+ timeframes : ClassVar [Mapping [TimeFrameLiteral , Union [Mapping [str , str ], str ]]] = {
6113+ "now" : "α αα" ,
6114+ "second" : {
6115+ "past" : "α¨α αα΅ α°α¨αα΅" ,
6116+ "future" : "α α αα΅ α°α¨αα΅" ,
6117+ },
6118+ "seconds" : {
6119+ "past" : "α¨ {0} α°α¨αα΅" ,
6120+ "future" : "α {0} α°α¨αα΅" ,
6121+ },
6122+ "minute" : {
6123+ "past" : "α¨α αα΅ α°αα" ,
6124+ "future" : "α α αα΅ α°αα" ,
6125+ },
6126+ "minutes" : {
6127+ "past" : "α¨ {0} α°αααα½" ,
6128+ "future" : "α {0} α°αααα½" ,
6129+ },
6130+ "hour" : {
6131+ "past" : "α¨α αα΅ α°αα΅" ,
6132+ "future" : "α α αα΅ α°αα΅" ,
6133+ },
6134+ "hours" : {
6135+ "past" : "α¨ {0} α°αα³α΅" ,
6136+ "future" : "α {0} α°α¨αα΅" ,
6137+ },
6138+ "day" : {
6139+ "past" : "α¨α αα΅ αα" ,
6140+ "future" : "α α αα΅ αα" ,
6141+ },
6142+ "days" : {
6143+ "past" : "α¨ {0} ααα΅" ,
6144+ "future" : "α {0} ααα΅" ,
6145+ },
6146+ "week" : {
6147+ "past" : "α¨α αα΅ α³ααα΅" ,
6148+ "future" : "α α αα΅ α³ααα΅" ,
6149+ },
6150+ "weeks" : {
6151+ "past" : "α¨ {0} α³ααα³α΅" ,
6152+ "future" : "α {0} α³ααα³α΅" ,
6153+ },
6154+ "month" : {
6155+ "past" : "α¨α αα΅ αα" ,
6156+ "future" : "α α αα΅ αα" ,
6157+ },
6158+ "months" : {
6159+ "past" : "α¨ {0} αα" ,
6160+ "future" : "α {0} αα«α΅" ,
6161+ },
6162+ "year" : {
6163+ "past" : "α¨α αα΅ α αα΅" ,
6164+ "future" : "α α αα΅ α αα΅" ,
6165+ },
6166+ "years" : {
6167+ "past" : "α¨ {0} ααα³α΅" ,
6168+ "future" : "α {0} ααα³α΅" ,
6169+ },
6170+ }
6171+ # Amharic: the general format to describe timeframe is different from past and future,
6172+ # so we do not copy the original timeframes dictionary
6173+ timeframes_only_distance = {
6174+ "second" : "α αα΅ α°α¨αα΅" ,
6175+ "seconds" : "{0} α°α¨αα΅" ,
6176+ "minute" : "α αα΅ α°αα" ,
6177+ "minutes" : "{0} α°αααα½" ,
6178+ "hour" : "α αα΅ α°αα΅" ,
6179+ "hours" : "{0} α°αα΅" ,
6180+ "day" : "α αα΅ αα" ,
6181+ "days" : "{0} ααα΅" ,
6182+ "week" : "α αα΅ α³ααα΅" ,
6183+ "weeks" : "{0} α³ααα΅" ,
6184+ "month" : "α αα΅ αα" ,
6185+ "months" : "{0} αα«α΅" ,
6186+ "year" : "α αα΅ α αα΅" ,
6187+ "years" : "{0} ααα³α΅" ,
6188+ }
6189+
6190+ month_names = [
6191+ "" ,
6192+ "ααα©ααͺ" ,
6193+ "αα₯α©ααͺ" ,
6194+ "ααα½" ,
6195+ "α€ααͺα" ,
6196+ "αα" ,
6197+ "αα" ,
6198+ "ααα" ,
6199+ "α¦αα΅α΅" ,
6200+ "α΄αα΄αα α" ,
6201+ "α¦ααΆα α" ,
6202+ "αα¬αα α" ,
6203+ "α²α΄αα α" ,
6204+ ]
6205+
6206+ month_abbreviations = [
6207+ "" ,
6208+ "ααα©" ,
6209+ "αα₯α©" ,
6210+ "ααα½" ,
6211+ "α€ααͺ" ,
6212+ "αα" ,
6213+ "αα" ,
6214+ "ααα" ,
6215+ "α¦αα΅" ,
6216+ "α΄αα΄" ,
6217+ "α¦ααΆ" ,
6218+ "αα¬α" ,
6219+ "α²α΄α" ,
6220+ ]
6221+
6222+ day_names = [
6223+ "" ,
6224+ "α°α" ,
6225+ "ααα°α" ,
6226+ "α¨α‘α" ,
6227+ "ααα΅" ,
6228+ "ααα₯" ,
6229+ "α
α³α" ,
6230+ "α₯αα΅" ,
6231+ ]
6232+ day_abbreviations = ["" , "α₯" , "α°" , "α" , "α¨" , "α" , "α" , "α
" ]
6233+
6234+ def _ordinal_number (self , n : int ) -> str :
6235+ return f"{ n } α"
6236+
6237+ def _format_timeframe (self , timeframe : TimeFrameLiteral , delta : int ) -> str :
6238+ """
6239+ Amharic awares time frame format function, takes into account
6240+ the differences between general, past, and future forms (three different suffixes).
6241+ """
6242+ abs_delta = abs (delta )
6243+ form = self .timeframes [timeframe ]
6244+
6245+ if isinstance (form , str ):
6246+ return form .format (abs_delta )
6247+
6248+ if delta > 0 :
6249+ key = "future"
6250+ else :
6251+ key = "past"
6252+ form = form [key ]
6253+
6254+ return form .format (abs_delta )
6255+
6256+ def describe (
6257+ self ,
6258+ timeframe : TimeFrameLiteral ,
6259+ delta : Union [float , int ] = 1 , # key is always future when only_distance=False
6260+ only_distance : bool = False ,
6261+ ) -> str :
6262+ """Describes a delta within a timeframe in plain language.
6263+
6264+ :param timeframe: a string representing a timeframe.
6265+ :param delta: a quantity representing a delta in a timeframe.
6266+ :param only_distance: return only distance eg: "11 seconds" without "in" or "ago" keywords
6267+ """
6268+
6269+ if not only_distance :
6270+ return super ().describe (timeframe , delta , only_distance )
6271+ humanized = self .timeframes_only_distance [timeframe ].format (trunc (abs (delta )))
6272+
6273+ return humanized
0 commit comments