Reorganize Language Switcher based on Country/Region I'm working on a site with 34+ languages and will likely be expanding to more. With this many countries, a simple drop-down list can be difficult for usability. I would like to customize the language switcher so that I can categorize a language by region and country. I have seen this before, have created similar on other non-Drupal sites, but haven't seen anything like it for Drupal.

Example:


Europe

Germany

DE

Switzerland

DE  
FR




etc.

I'm looking for either a module, or a head start on what I might do short of writing some custom PHP for the project.
You can take a clue from below modules..


Hierarchical Select Module ...



  Hierarchical Select module defines the "hierarchical_select" form
  element, which is a greatly enhanced way for letting the user select
  items in a hierarchy.





Language Switcher Dropdown Module..



  Language Switcher Dropdown is a very simple module that exposes a new
  block, similar to the default Language Switcher block provided by
  Locale module. The new block allows site visitors to switch languages
  using a drop-down select list instead of using hyperlinks.





You need to build a custom module which displays region > countries using hierarchical select module
On Form Submit you need to do below actions which lang drop down does to redirect.


Please find submit handler code below from lang dropdown module..

function lang_dropdown_form_submit($form, &amp;$form_state) {

  $language_code = check_plain($form_state['values']['lang_dropdown_select']);
  $type = $form_state['values']['lang_dropdown_type'];
  $tohome = $form_state['values']['lang_dropdown_tohome'];

  $language_codes = locale_language_list('language');
  if (!in_array($language_code, $language_codes)) return;

  $types = language_types_configurable(FALSE);
  if (!in_array($type, $types)) $type = 'language';

  $path = drupal_is_front_page() ? '&lt;front&gt;' : $_GET['q'];
  $languages = language_negotiation_get_switch_links($type, $path);

  $language = $languages-&gt;links[$language_code];

  $newpath = (isset($language['href']) &amp;&amp; $tohome == 0) ? $language['href'] : '&lt;front&gt;';

  if (!isset($language['query'])) {
    $language['query'] = drupal_get_query_parameters();
  }

  $form_state['redirect'] = array($newpath, $language);

}