tools/l10n/generate_locales_list.py
def gen_locales(locales):  # type: (list) -> str
    """Returns the generated code for the locale list.

    The list is guaranteed to be in sorted order without duplicates.

    >>> locales = ['en-GB', 'en', 'de', 'en']
    >>> generated = gen_locales(locales)
    >>> locales.pop()  # remove the duplicate
    'en'
    >>> locales.sort()
    >>> index_in_generated = lambda locale: generated.index(gen_locale(locale))
    >>> all(
    ...     index_in_generated(prev_locale) < index_in_generated(next_locale)
    ...     for prev_locale, next_locale in zip(locales, locales[1:]))
    True
    """
    return '\n'.join(gen_locale(locale) for locale in sorted(set(locales)))
Returns the generated code for the locale list.

    The list is guaranteed to be in sorted order without duplicates.

    >>> locales = ['en-GB', 'en', 'de', 'en']
    >>> generated = gen_locales(locales)
    >>> locales.pop()  # remove the duplicate
    'en'
    >>> locales.sort()
    >>> index_in_generated = lambda locale: generated.index(gen_locale(locale))
    >>> all(
    ...     index_in_generated(prev_locale) < index_in_generated(next_locale)
    ...     for prev_locale, next_locale in zip(locales, locales[1:]))
    True
    
Returns the generated code for the locale list.
The list is guaranteed to be in sorted order without duplicates.


Returns the generated code for the locale list . The list is guaranteed to be in sorted order without duplicates .
def gen_locales(locales):  
    return '\n'.join(gen_locale(locale) for locale in sorted(set(locales)))
def gen_locales ( locales ) : return '\n' . join ( gen_locale ( locale ) for locale in sorted ( set ( locales ) ) )
Returns the generated code for the locale list.
Returns the generated code for the locale list .
# type: (list) -> str """Returns the generated code for the locale list.

    The list is guaranteed to be in sorted order without duplicates.

    >>> locales = ['en-GB', 'en', 'de', 'en']
    >>> generated = gen_locales(locales)
    >>> locales.pop()  # remove the duplicate
    'en'
    >>> locales.sort()
    >>> index_in_generated = lambda locale: generated.index(gen_locale(locale))
    >>> all(
    ...     index_in_generated(prev_locale) < index_in_generated(next_locale)
    ...     for prev_locale, next_locale in zip(locales, locales[1:]))
    True
    """
locales