# {py:mod}`arelle.Locale` ```{py:module} arelle.Locale ``` ```{autodoc2-docstring} arelle.Locale :allowtitles: ``` ## Module Contents ### Functions ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`_getUserLocaleUnsafe ` - ```{autodoc2-docstring} arelle.Locale._getUserLocaleUnsafe :summary: ``` * - {py:obj}`getUserLocale ` - ```{autodoc2-docstring} arelle.Locale.getUserLocale :summary: ``` * - {py:obj}`getLanguageCode ` - ```{autodoc2-docstring} arelle.Locale.getLanguageCode :summary: ``` * - {py:obj}`getLanguageCodes ` - ```{autodoc2-docstring} arelle.Locale.getLanguageCodes :summary: ``` * - {py:obj}`_unsafeIsLocaleCompatible ` - ```{autodoc2-docstring} arelle.Locale._unsafeIsLocaleCompatible :summary: ``` * - {py:obj}`_unsafeFindCompatibleLocale ` - ```{autodoc2-docstring} arelle.Locale._unsafeFindCompatibleLocale :summary: ``` * - {py:obj}`findCompatibleLocale ` - ```{autodoc2-docstring} arelle.Locale.findCompatibleLocale :summary: ``` * - {py:obj}`_candidateLocaleCodes ` - ```{autodoc2-docstring} arelle.Locale._candidateLocaleCodes :summary: ``` * - {py:obj}`bcp47LangToPosixLocale ` - ```{autodoc2-docstring} arelle.Locale.bcp47LangToPosixLocale :summary: ``` * - {py:obj}`posixLocaleToBCP47Lang ` - ```{autodoc2-docstring} arelle.Locale.posixLocaleToBCP47Lang :summary: ``` * - {py:obj}`_buildPosixLocale ` - ```{autodoc2-docstring} arelle.Locale._buildPosixLocale :summary: ``` * - {py:obj}`_buildBCP47LanguageTag ` - ```{autodoc2-docstring} arelle.Locale._buildBCP47LanguageTag :summary: ``` * - {py:obj}`_getPosixLocaleLangRegionAndEncoding ` - ```{autodoc2-docstring} arelle.Locale._getPosixLocaleLangRegionAndEncoding :summary: ``` * - {py:obj}`getLocale ` - ```{autodoc2-docstring} arelle.Locale.getLocale :summary: ``` * - {py:obj}`_tryRunShellCommand ` - ```{autodoc2-docstring} arelle.Locale._tryRunShellCommand :summary: ``` * - {py:obj}`getLocaleList ` - ```{autodoc2-docstring} arelle.Locale.getLocaleList :summary: ``` * - {py:obj}`availableLocales ` - ```{autodoc2-docstring} arelle.Locale.availableLocales :summary: ``` * - {py:obj}`languageCodes ` - ```{autodoc2-docstring} arelle.Locale.languageCodes :summary: ``` * - {py:obj}`setApplicationLocale ` - ```{autodoc2-docstring} arelle.Locale.setApplicationLocale :summary: ``` * - {py:obj}`setDisableRTL ` - ```{autodoc2-docstring} arelle.Locale.setDisableRTL :summary: ``` * - {py:obj}`rtlString ` - ```{autodoc2-docstring} arelle.Locale.rtlString :summary: ``` * - {py:obj}`_grouping_intervals ` - ```{autodoc2-docstring} arelle.Locale._grouping_intervals :summary: ``` * - {py:obj}`_group ` - ```{autodoc2-docstring} arelle.Locale._group :summary: ``` * - {py:obj}`_strip_padding ` - ```{autodoc2-docstring} arelle.Locale._strip_padding :summary: ``` * - {py:obj}`format ` - ```{autodoc2-docstring} arelle.Locale.format :summary: ``` * - {py:obj}`_format ` - ```{autodoc2-docstring} arelle.Locale._format :summary: ``` * - {py:obj}`format_string ` - ```{autodoc2-docstring} arelle.Locale.format_string :summary: ``` * - {py:obj}`currency ` - ```{autodoc2-docstring} arelle.Locale.currency :summary: ``` * - {py:obj}`ftostr ` - ```{autodoc2-docstring} arelle.Locale.ftostr :summary: ``` * - {py:obj}`atof ` - ```{autodoc2-docstring} arelle.Locale.atof :summary: ``` * - {py:obj}`atoi ` - ```{autodoc2-docstring} arelle.Locale.atoi :summary: ``` * - {py:obj}`format_picture ` - ```{autodoc2-docstring} arelle.Locale.format_picture :summary: ``` * - {py:obj}`format_decimal ` - ```{autodoc2-docstring} arelle.Locale.format_decimal :summary: ``` ```` ### Data ````{list-table} :class: autosummary longtable :align: left * - {py:obj}`_ ` - ```{autodoc2-docstring} arelle.Locale._ :summary: ``` * - {py:obj}`CHAR_MAX ` - ```{autodoc2-docstring} arelle.Locale.CHAR_MAX :summary: ``` * - {py:obj}`LC_ALL ` - ```{autodoc2-docstring} arelle.Locale.LC_ALL :summary: ``` * - {py:obj}`LC_COLLATE ` - ```{autodoc2-docstring} arelle.Locale.LC_COLLATE :summary: ``` * - {py:obj}`LC_CTYPE ` - ```{autodoc2-docstring} arelle.Locale.LC_CTYPE :summary: ``` * - {py:obj}`LC_MESSAGES ` - ```{autodoc2-docstring} arelle.Locale.LC_MESSAGES :summary: ``` * - {py:obj}`LC_MONETARY ` - ```{autodoc2-docstring} arelle.Locale.LC_MONETARY :summary: ``` * - {py:obj}`LC_NUMERIC ` - ```{autodoc2-docstring} arelle.Locale.LC_NUMERIC :summary: ``` * - {py:obj}`LC_TIME ` - ```{autodoc2-docstring} arelle.Locale.LC_TIME :summary: ``` * - {py:obj}`defaultLocaleCodes ` - ```{autodoc2-docstring} arelle.Locale.defaultLocaleCodes :summary: ``` * - {py:obj}`MACOS_PLATFORM ` - ```{autodoc2-docstring} arelle.Locale.MACOS_PLATFORM :summary: ``` * - {py:obj}`WINDOWS_PLATFORM ` - ```{autodoc2-docstring} arelle.Locale.WINDOWS_PLATFORM :summary: ``` * - {py:obj}`BCP47_LANGUAGE_REGION_SEPARATOR ` - ```{autodoc2-docstring} arelle.Locale.BCP47_LANGUAGE_REGION_SEPARATOR :summary: ``` * - {py:obj}`POSIX_LANGUAGE_REGION_SEPARATOR ` - ```{autodoc2-docstring} arelle.Locale.POSIX_LANGUAGE_REGION_SEPARATOR :summary: ``` * - {py:obj}`POSIX_LOCALE_ENCODING_SEPARATOR ` - ```{autodoc2-docstring} arelle.Locale.POSIX_LOCALE_ENCODING_SEPARATOR :summary: ``` * - {py:obj}`BCP47_LANGUAGE_TAG ` - ```{autodoc2-docstring} arelle.Locale.BCP47_LANGUAGE_TAG :summary: ``` * - {py:obj}`_locale ` - ```{autodoc2-docstring} arelle.Locale._locale :summary: ``` * - {py:obj}`iso3region ` - ```{autodoc2-docstring} arelle.Locale.iso3region :summary: ``` * - {py:obj}`_systemLocales ` - ```{autodoc2-docstring} arelle.Locale._systemLocales :summary: ``` * - {py:obj}`_languageCodes ` - ```{autodoc2-docstring} arelle.Locale._languageCodes :summary: ``` * - {py:obj}`_disableRTL ` - ```{autodoc2-docstring} arelle.Locale._disableRTL :summary: ``` * - {py:obj}`_percent_re ` - ```{autodoc2-docstring} arelle.Locale._percent_re :summary: ``` ```` ### API ````{py:data} _ :canonical: arelle.Locale._ :type: arelle.typing.TypeGetText :value: > None ```{autodoc2-docstring} arelle.Locale._ ``` ```` ````{py:data} CHAR_MAX :canonical: arelle.Locale.CHAR_MAX :value: > 127 ```{autodoc2-docstring} arelle.Locale.CHAR_MAX ``` ```` ````{py:data} LC_ALL :canonical: arelle.Locale.LC_ALL :value: > 6 ```{autodoc2-docstring} arelle.Locale.LC_ALL ``` ```` ````{py:data} LC_COLLATE :canonical: arelle.Locale.LC_COLLATE :value: > 3 ```{autodoc2-docstring} arelle.Locale.LC_COLLATE ``` ```` ````{py:data} LC_CTYPE :canonical: arelle.Locale.LC_CTYPE :value: > 0 ```{autodoc2-docstring} arelle.Locale.LC_CTYPE ``` ```` ````{py:data} LC_MESSAGES :canonical: arelle.Locale.LC_MESSAGES :value: > 5 ```{autodoc2-docstring} arelle.Locale.LC_MESSAGES ``` ```` ````{py:data} LC_MONETARY :canonical: arelle.Locale.LC_MONETARY :value: > 4 ```{autodoc2-docstring} arelle.Locale.LC_MONETARY ``` ```` ````{py:data} LC_NUMERIC :canonical: arelle.Locale.LC_NUMERIC :value: > 1 ```{autodoc2-docstring} arelle.Locale.LC_NUMERIC ``` ```` ````{py:data} LC_TIME :canonical: arelle.Locale.LC_TIME :value: > 2 ```{autodoc2-docstring} arelle.Locale.LC_TIME ``` ```` ````{py:data} defaultLocaleCodes :canonical: arelle.Locale.defaultLocaleCodes :value: > None ```{autodoc2-docstring} arelle.Locale.defaultLocaleCodes ``` ```` ````{py:data} MACOS_PLATFORM :canonical: arelle.Locale.MACOS_PLATFORM :value: > 'darwin' ```{autodoc2-docstring} arelle.Locale.MACOS_PLATFORM ``` ```` ````{py:data} WINDOWS_PLATFORM :canonical: arelle.Locale.WINDOWS_PLATFORM :value: > 'win32' ```{autodoc2-docstring} arelle.Locale.WINDOWS_PLATFORM ``` ```` ````{py:data} BCP47_LANGUAGE_REGION_SEPARATOR :canonical: arelle.Locale.BCP47_LANGUAGE_REGION_SEPARATOR :value: > '-' ```{autodoc2-docstring} arelle.Locale.BCP47_LANGUAGE_REGION_SEPARATOR ``` ```` ````{py:data} POSIX_LANGUAGE_REGION_SEPARATOR :canonical: arelle.Locale.POSIX_LANGUAGE_REGION_SEPARATOR :value: > '_' ```{autodoc2-docstring} arelle.Locale.POSIX_LANGUAGE_REGION_SEPARATOR ``` ```` ````{py:data} POSIX_LOCALE_ENCODING_SEPARATOR :canonical: arelle.Locale.POSIX_LOCALE_ENCODING_SEPARATOR :value: > '.' ```{autodoc2-docstring} arelle.Locale.POSIX_LOCALE_ENCODING_SEPARATOR ``` ```` ````{py:data} BCP47_LANGUAGE_TAG :canonical: arelle.Locale.BCP47_LANGUAGE_TAG :value: > 'compile(...)' ```{autodoc2-docstring} arelle.Locale.BCP47_LANGUAGE_TAG ``` ```` ````{py:function} _getUserLocaleUnsafe(posixLocale: str = '') -> tuple[arelle.typing.LocaleDict, str | None] :canonical: arelle.Locale._getUserLocaleUnsafe ```{autodoc2-docstring} arelle.Locale._getUserLocaleUnsafe ``` ```` ````{py:function} getUserLocale(posixLocale: str | None = None) -> tuple[arelle.typing.LocaleDict, str | None] :canonical: arelle.Locale.getUserLocale ```{autodoc2-docstring} arelle.Locale.getUserLocale ``` ```` ````{py:function} getLanguageCode() -> str :canonical: arelle.Locale.getLanguageCode ```{autodoc2-docstring} arelle.Locale.getLanguageCode ``` ```` ````{py:function} getLanguageCodes(configLang: str | None = None) -> list[str] :canonical: arelle.Locale.getLanguageCodes ```{autodoc2-docstring} arelle.Locale.getLanguageCodes ``` ```` ````{py:function} _unsafeIsLocaleCompatible(localeValue: str) -> bool :canonical: arelle.Locale._unsafeIsLocaleCompatible ```{autodoc2-docstring} arelle.Locale._unsafeIsLocaleCompatible ``` ```` ````{py:function} _unsafeFindCompatibleLocale(localeValue: str) -> str | None :canonical: arelle.Locale._unsafeFindCompatibleLocale ```{autodoc2-docstring} arelle.Locale._unsafeFindCompatibleLocale ``` ```` ````{py:function} findCompatibleLocale(localeValue: str | None) -> str | None :canonical: arelle.Locale.findCompatibleLocale ```{autodoc2-docstring} arelle.Locale.findCompatibleLocale ``` ```` ````{py:function} _candidateLocaleCodes(posixLocale: str) -> list[str] :canonical: arelle.Locale._candidateLocaleCodes ```{autodoc2-docstring} arelle.Locale._candidateLocaleCodes ``` ```` ````{py:function} bcp47LangToPosixLocale(bcp47Lang: str) -> str :canonical: arelle.Locale.bcp47LangToPosixLocale ```{autodoc2-docstring} arelle.Locale.bcp47LangToPosixLocale ``` ```` ````{py:function} posixLocaleToBCP47Lang(posixLocale: str) -> str :canonical: arelle.Locale.posixLocaleToBCP47Lang ```{autodoc2-docstring} arelle.Locale.posixLocaleToBCP47Lang ``` ```` ````{py:function} _buildPosixLocale(lang: str, region: str | None = None, encoding: str | None = None) -> str :canonical: arelle.Locale._buildPosixLocale ```{autodoc2-docstring} arelle.Locale._buildPosixLocale ``` ```` ````{py:function} _buildBCP47LanguageTag(lang: str, region: str | None = None) -> str :canonical: arelle.Locale._buildBCP47LanguageTag ```{autodoc2-docstring} arelle.Locale._buildBCP47LanguageTag ``` ```` ````{py:function} _getPosixLocaleLangRegionAndEncoding(posixLocale: str) -> tuple[str, str | None, str | None] :canonical: arelle.Locale._getPosixLocaleLangRegionAndEncoding ```{autodoc2-docstring} arelle.Locale._getPosixLocaleLangRegionAndEncoding ``` ```` ````{py:data} _locale :canonical: arelle.Locale._locale :value: > None ```{autodoc2-docstring} arelle.Locale._locale ``` ```` ````{py:function} getLocale() -> str | None :canonical: arelle.Locale.getLocale ```{autodoc2-docstring} arelle.Locale.getLocale ``` ```` ````{py:function} _tryRunShellCommand(*args: str) -> str | None :canonical: arelle.Locale._tryRunShellCommand ```{autodoc2-docstring} arelle.Locale._tryRunShellCommand ``` ```` ````{py:data} iso3region :canonical: arelle.Locale.iso3region :value: > None ```{autodoc2-docstring} arelle.Locale.iso3region ``` ```` ````{py:data} _systemLocales :canonical: arelle.Locale._systemLocales :value: > None ```{autodoc2-docstring} arelle.Locale._systemLocales ``` ```` ````{py:function} getLocaleList() -> list[str] :canonical: arelle.Locale.getLocaleList ```{autodoc2-docstring} arelle.Locale.getLocaleList ``` ```` ````{py:function} availableLocales() -> set[str] :canonical: arelle.Locale.availableLocales ```{autodoc2-docstring} arelle.Locale.availableLocales ``` ```` ````{py:data} _languageCodes :canonical: arelle.Locale._languageCodes :value: > None ```{autodoc2-docstring} arelle.Locale._languageCodes ``` ```` ````{py:function} languageCodes() -> dict[str, str] :canonical: arelle.Locale.languageCodes ```{autodoc2-docstring} arelle.Locale.languageCodes ``` ```` ````{py:function} setApplicationLocale() -> None :canonical: arelle.Locale.setApplicationLocale ```{autodoc2-docstring} arelle.Locale.setApplicationLocale ``` ```` ````{py:data} _disableRTL :canonical: arelle.Locale._disableRTL :type: bool :value: > False ```{autodoc2-docstring} arelle.Locale._disableRTL ``` ```` ````{py:function} setDisableRTL(disableRTL: bool) -> None :canonical: arelle.Locale.setDisableRTL ```{autodoc2-docstring} arelle.Locale.setDisableRTL ``` ```` ````{py:function} rtlString(source: str, lang: str | None) -> str :canonical: arelle.Locale.rtlString ```{autodoc2-docstring} arelle.Locale.rtlString ``` ```` ````{py:function} _grouping_intervals(grouping: list[int]) -> typing.Generator[int, None, None] :canonical: arelle.Locale._grouping_intervals ```{autodoc2-docstring} arelle.Locale._grouping_intervals ``` ```` ````{py:function} _group(conv: arelle.typing.LocaleDict, s: str, monetary: bool = False) -> tuple[str, int] :canonical: arelle.Locale._group ```{autodoc2-docstring} arelle.Locale._group ``` ```` ````{py:function} _strip_padding(s: str, amount: int) -> str :canonical: arelle.Locale._strip_padding ```{autodoc2-docstring} arelle.Locale._strip_padding ``` ```` ````{py:data} _percent_re :canonical: arelle.Locale._percent_re :value: > 'compile(...)' ```{autodoc2-docstring} arelle.Locale._percent_re ``` ```` ````{py:function} format(conv: arelle.typing.LocaleDict, percent: str, value: typing.Any, grouping: bool = False, monetary: bool = False, *additional: str) -> str :canonical: arelle.Locale.format ```{autodoc2-docstring} arelle.Locale.format ``` ```` ````{py:function} _format(conv: arelle.typing.LocaleDict, percent: str, value: typing.Any, grouping: bool = False, monetary: bool = False, *additional: str) -> str :canonical: arelle.Locale._format ```{autodoc2-docstring} arelle.Locale._format ``` ```` ````{py:function} format_string(conv: arelle.typing.LocaleDict, f: str, val: typing.Any, grouping: bool = False) -> str :canonical: arelle.Locale.format_string ```{autodoc2-docstring} arelle.Locale.format_string ``` ```` ````{py:function} currency(conv: arelle.typing.LocaleDict, val: int | float, symbol: bool = True, grouping: bool = False, international: bool = False) -> str :canonical: arelle.Locale.currency ```{autodoc2-docstring} arelle.Locale.currency ``` ```` ````{py:function} ftostr(conv: arelle.typing.LocaleDict, val: typing.Any) -> str :canonical: arelle.Locale.ftostr ```{autodoc2-docstring} arelle.Locale.ftostr ``` ```` ````{py:function} atof(conv: arelle.typing.LocaleDict, string: str, func: typing.Callable[[str], typing.Any] = float) -> typing.Any :canonical: arelle.Locale.atof ```{autodoc2-docstring} arelle.Locale.atof ``` ```` ````{py:function} atoi(conv: arelle.typing.LocaleDict, str: arelle.Locale.atoi.str) -> int :canonical: arelle.Locale.atoi ```{autodoc2-docstring} arelle.Locale.atoi ``` ```` ````{py:function} format_picture(conv: arelle.typing.LocaleDict, value: typing.Any, picture: str) -> str :canonical: arelle.Locale.format_picture ```{autodoc2-docstring} arelle.Locale.format_picture ``` ```` ````{py:function} format_decimal(conv: arelle.typing.LocaleDict | None, value: decimal.Decimal, intPlaces: int = 1, fractPlaces: int = 2, curr: str = '', sep: str | None = None, grouping: int | None = None, dp: str | None = None, pos: str | None = None, neg: str | None = None, trailpos: str | None = None, trailneg: str | None = None) -> str :canonical: arelle.Locale.format_decimal ```{autodoc2-docstring} arelle.Locale.format_decimal ``` ````