0

i18n : Best practice

Posted July 1st, 2010 in by thomas
  • a. Install i18n module
  • b. Add all the required languages in admin/settings/language
  • c. Configure the “Language negociation” to “path prefix only” in admin/settings/language/configure
  • d. Configure the “Content selection mode” to “Current language and language neutral” and check the “Switch interface for translating” in admin/settings/language/i18n
  • e. Make some variables multilanguage by adding a few lines in you settings.php file :
    /**
    * Multilingual settings
    *
    * This is a collection of variables that can be set up
    * for each language when i18n is enabled.
    * These are the basic ones for Drupal core,
    * but you can add your own here.
    */
    $conf['i18n_variables'] = array(
    // Site name, slogan, mission, etc..
    'site_name',
    'site_slogan',
    'site_mission',
    'site_footer',
    'anonymous',
    // Different front page for each language
    'site_frontpage',
    // Primary and secondary links
    'menu_primary_links_source',
    'menu_secondary_links_source',
    'menu_default_node_menu',
    // Contact form information
    'contact_form_information',
    );

This is the reason why I checked the “Switch interface for translating”, so if you go to “admin/settings/site-information” or “admin/build/menu/settings” and switch the language you can change the Site information and menu per language.

To be sure, you should see “This is a multilingual variable.” next to each variable you put in the settings file.

i18n : Menus and primary / secondary links

After a lot of problems with i18n and primary links, I finally decided to read the i18n documentation from A to Z, and the solution was there at page 2.

See the complete documentation.

Leave a Reply