bacommon.locale

Functionality for wrangling locale info.

 1# Released under the MIT License. See LICENSE for details.
 2#
 3"""Functionality for wrangling locale info."""
 4
 5from __future__ import annotations
 6
 7from enum import Enum
 8from typing import TYPE_CHECKING
 9
10if TYPE_CHECKING:
11    pass
12
13
14class Locale(Enum):
15    """A distinct combination of language and possibly country/etc.
16
17    Note that some locales here may be superseded by other more specific
18    ones (for instance PORTUGUESE -> PORTUGUESE_BRAZIL), but the
19    originals must continue to exist here since they may remain in use
20    in the wild.
21    """
22
23    ENGLISH = 'en'
class Locale(enum.Enum):
15class Locale(Enum):
16    """A distinct combination of language and possibly country/etc.
17
18    Note that some locales here may be superseded by other more specific
19    ones (for instance PORTUGUESE -> PORTUGUESE_BRAZIL), but the
20    originals must continue to exist here since they may remain in use
21    in the wild.
22    """
23
24    ENGLISH = 'en'

A distinct combination of language and possibly country/etc.

Note that some locales here may be superseded by other more specific ones (for instance PORTUGUESE -> PORTUGUESE_BRAZIL), but the originals must continue to exist here since they may remain in use in the wild.

ENGLISH = <Locale.ENGLISH: 'en'>