code: def _localized_name(val, klass):
      
      try:
          (text, lang) = val
          return klass(text=text, lang=lang)
      except ValueError:
          return klass(text=val, lang="en")
docs: If no language is defined 'en' is the default