Skip to main content

get_supported_language_variant

Returns the provided language code if it matches the system's default language setting, otherwise raises a LookupError.

def get_supported_language_variant(
lang_code: string,
strict: boolean = False
) - > string

Returns the language code if it matches the default system language, otherwise raises a LookupError.

Parameters

NameTypeDescription
lang_codestringThe BCP 47 language tag or language identifier to be validated against supported variants.
strictboolean = FalseDetermines if the matching logic should apply strict validation rules, though currently unused in the core logic.

Returns

TypeDescription
stringThe validated language code that matches the system's default language setting.