code: def build_css_class(localized_fieldname, prefix=''):
      
      bits = localized_fieldname.split('_')
      css_class = ''
      if len(bits) == 1:
          css_class = str(localized_fieldname)
      elif len(bits) == 2:
          # Fieldname without underscore and short language code
          # Examples:
          # 'foo_de' --> 'foo-de',
          # 'bar_en' --> 'bar-en'
          css_class = '-'.join(bits)
      elif len(bits) > 2:
          # Try regionalized language code
          # Examples:
          # 'foo_es_ar' --> 'foo-es_ar',
          # 'foo_bar_zh_tw' --> 'foo_bar-zh_tw'
          css_class = _join_css_class(bits, 2)
          if not css_class:
              # Try short language code
              # Examples:
              # 'foo_bar_de' --> 'foo_bar-de',
              # 'foo_bar_baz_de' --> 'foo_bar_baz-de'
              css_class = _join_css_class(bits, 1)
      return '%s-%s' % (prefix, css_class) if prefix else css_class
docs: Returns a css class based on ``localized_fieldname`` which is easily
      splitable and capable of regionalized language codes.
  
      Takes an optional ``prefix`` which is prepended to the returned string.