def gen_locale(locale):  # type: (str) -> str
    """Returns the generated code for a given locale in the list."""
    # We assume that all locale codes have only letters, numbers and hyphens.
    assert locale.replace('-', '').isalnum(), locale
    # clang-format enforces a four-space indent for initializer lists.
    return '    PLATFORM_LOCALE({locale})'.format(locale=locale)