@library.global_function
def langcode_to_name(code, locale=None):
 if (not locale):
  locale = get_language()
 translated_languages = get_languages_for_locale(locale)
 try:
  lang = dict(translated_languages)[code]
 except KeyError:
  return code
 return lang

@ library . global_function def langcode_to_name ( code , locale = None ) : if ( not locale ) : locale = get_language ( ) translated_languages = get_languages_for_locale ( locale ) try : lang = dict ( translated_languages ) [ code ] except KeyError : return code return lang
return the language name for the code in locale .