def notation(language: str = "en") -> str: """Return calendar era notation. :param language: Language tag for localized notation. Full locale name can be used, e.g. ``en-US`` or ``en_US.UTF-8``. Supported languages are ``en``, ``ar`` and ``bn``. :type language: str """ return locales.get_locale(language).gregorian_notation
def day_name(self, language: str = "en") -> str: """Return day name. :param language: Language tag for localized day name. Full locale name can be used, e.g. ``en-US`` or ``en_US.UTF-8``. Supported languages are ``en``, ``ar`` and ``bn``. :type language: str """ return locales.get_locale(language).day_name(self.isoweekday())
def month_name(self, language: str = "en") -> str: """Return month name. :param language: Language tag for localized month name. Full locale name can be used, e.g. ``en-US`` or ``en_US.UTF-8``. Supported languages are ``en``, ``ar`` and ``bn``. :type language: str """ return locales.get_locale(language).gregorian_month_name(self.month)
def notation(language: str = "en") -> str: """Return calendar era notation. Args: language: Language tag for localized month name. Full locale name can be used, e.g. ``en-US`` or ``en_US.UTF-8``. Supported languages are ``en``, ``ar`` and ``bn``. """ return locales.get_locale(language).notation
def test_unsupported_language(self): with pytest.raises(ValueError): locales.get_locale("xy")
def test_locale_possible_names(self, test_input): assert locales.get_locale(test_input).__class__ == self.CustomLocale