Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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())
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    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
Exemplo n.º 5
0
 def test_unsupported_language(self):
     with pytest.raises(ValueError):
         locales.get_locale("xy")
Exemplo n.º 6
0
 def test_locale_possible_names(self, test_input):
     assert locales.get_locale(test_input).__class__ == self.CustomLocale