Basic site set up

Last modified: September 25, 2008 - 10:30

Follow the steps below to set up a basic multilingual site with the most common options selected.

Installing and Enabling the i18n Package

  • Download and install the package
  • Enable the following modules: locale, internationalization, and translation
  • Set up your basic modules
  • Define your languages

These are the basic modules you need to enable to have a multilingual site:

Modules
Figure 1: Modules in i18n package

Once the modules are enabled, visit the module settings page and go to Administer>Site Configuration>Multilingual system

Multilingual settings
Figure 2: Basic multilingual settings

When the internationalization module is enabled, there are two additional options in the language management page: a text field to name the native language name and a check box to mark the language as LTR (left to right). This latter option has no further effect unless it is handled properly by the theme.

Extended language options
Figure 3: Language set up

Enabling Multilingual Content

  • Enable the language block
  • Enable multilingual support for specific content types

Now you have to enable the content types you want to be in multiple languages. This can be done on Administer>Content>Content types for each content type. A new option to enable/disable multilingual support will appear at the bottom of the settings page.

Content type settings
Figure 4: Enable content types to be multilingual

New! There's a new option for content types called extended language support. It will allow you to set all defined languages - not only enabled ones - for selected content types. With this feature enabled, it is possible to have a site in a few languages, which will be the ones enabled, showing in the languages block and used for localization, while allowing a larger number of languages for some content types.

Regions go missing

psymes - September 2, 2008 - 10:25

I have added some extra regions in my some of my templates.
However, once I activate the Internationalization modules these regions stop to show up

It seems that the changed URL has something to do with it.

For example, if this was the URL before: www.mysite.com/mypage
Internationalization would then change the link to this page to www.mysite.com/en/mypage (for english). On this changed URL my custom region is gone.

Odd thing if I remove the /en/ bit from URL ie just by backspacing it out in the browsers address field - the region shows up again, so it is not the module per se that has an effect

Apparently it is that little injected '/en/' makes the page disconnect from to the region.
Why does this happen, and how do I remedy it?

Peter Symes
Editor
X-Ray International Dive Magazine

Similar Problem

heckacopter213 - December 23, 2008 - 00:43

In my theme, I make heavy use of page-[name].tpl.php files. Now, I need to create another copy of the files for every language I'm using: page-[language code]-[name].tpl.php. This will be a nightmare. Is there any other solution?

--EDIT. I found the solution.

In template.php, I needed to strip the current language out of alias so that it would resolve the correct page. I know this won't solve your problem, but maybe it will help somebody.

function theme_preprocess_page(&$vars) {

//use template alias
if (module_exists('path')) {
$alias = drupal_get_path_alias(str_replace('/edit','',$_GET['q']));
$alias = str_replace(i18n_get_lang().'/', '', $alias);
if ($alias != $_GET['q']) {
$suggestions = array();
$template_filename = 'page';
foreach (explode('/', $alias) as $path_part) {
$template_filename = $template_filename . '-' . $path_part;
$suggestions[] = $template_filename;
}
}
$vars['template_files'] = $suggestions;
}
}

 
 

Drupal is a registered trademark of Dries Buytaert.