def format_wagtail_locale_id()

in src/wagtail_localize_smartling/utils.py [0:0]


def format_wagtail_locale_id(locale_id: str) -> str:
    """
    The opposite of format_smartling_locale_id.

    Returns everything lower case unless the REFORMAT_LANGUAGE_CODES setting is
    False.
    """
    # Apply any mapping defined in settings
    locale_id = smartling_settings.SMARTLING_LOCALE_TO_LOCALE.get(locale_id, locale_id)

    if not smartling_settings.REFORMAT_LANGUAGE_CODES:
        return locale_id

    return locale_id.lower()