def language_code_select(priority_languages, options, html_options)
      selected = object.send(@method_name) if object.respond_to?(@method_name)

      languages = ""

      if options.present? and options[:include_blank]
        option = options[:include_blank] == true ? "" : options[:include_blank]
        languages += "<option>#{option}</option>\n"
      end

      if priority_languages
        languages += options_for_select(priority_languages, selected)
        languages += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
      end

      languages = languages + options_for_select(language_translations, selected)

      html_options = html_options.stringify_keys
      add_default_name_and_id(html_options)

      content_tag(:select, languages.html_safe, html_options)
    end
def language_code_select(priority_languages, options, html_options)
      selected = object.send(@method_name) if object.respond_to?(@method_name)

      languages = ""

      if options.present? and options[:include_blank]
        option = options[:include_blank] == true ? "" : options[:include_blank]
        languages += "<option>#{option}</option>\n"
      end

      if priority_languages
        languages += options_for_select(priority_languages, selected)
        languages += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
      end

      languages = languages + options_for_select(language_translations, selected)

      html_options = html_options.stringify_keys
      add_default_name_and_id(html_options)

      content_tag(:select, languages.html_safe, html_options)
    end
Adapted from Rails language_select. Just uses language codes instead of full names.