pysepal.solara.locale.describe_offered_locales#

pysepal.solara.locale.describe_offered_locales(offered, catalog)[source]#

Pair each offered locale code with a display name and flag.

offered comes from the app’s message folders and is authoritative: every code is returned, because a catalog the app ships must be selectable. catalog only supplies presentation, matched through match_offered_locale(), so a bare es borrows the name and flag of es-ES while keeping es as its value – the value is a folder name that Translator has to be able to find.

Parameters:
  • offered (Iterable[str]) – Locale codes the app has catalogs for.

  • catalog (Iterable[Dict[str, str]]) – Display records, each with code, name and flag.

Returns:

One record per offered code, sorted by display name.

Return type:

List[Dict[str, str]]