ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

module documentation

Validate locale codes shared by translators and filesystem loaders.

Function validate_locale Validate a locale code and return its original spelling.
Constant _LOCALE_PATTERN Accept alphanumeric locale segments separated by hyphens or underscores.
def validate_locale(locale: str) -> str: (source)

Validate a locale code and return its original spelling.

Parameters
locale:strLocale code to validate without normalizing its case or separators.
Returns
strThe unchanged, validated locale code.
Raises
orionis.localization.InvalidLocaleExceptionIf the locale is empty, malformed, or unsafe for path use.
_LOCALE_PATTERN = (source)

Accept alphanumeric locale segments separated by hyphens or underscores.

Value
re.compile(r'[A-Za-z0-9]+(?:[_-][A-Za-z0-9]+)*')