Beruflich Dokumente
Kultur Dokumente
org
http://drupal-translation.com/
We'll cover how to set up a Drupal site to hold contents in multiple languages, how to create and manage multilingual contents and how to let visitors choose the display language. Installing the required modules Setting up the languages Enabling Multilingual support for Content Preparing content for translation Creating translations Adding the language switcher Setting the front page per language Adding a menu Using a different domain name for each language Adding language icons Block content translation Drupal core translations Common questions
Enable the multi-language modules http://yourdomain.com/admin/build/modules Administer > Site Building > Modules Enable all the modules under "Multilanguage" and save the configuration. *
* Note: This site has been updated to the 6.x.1.1 release of i18n. i18n version used in this tutorial: Official releases 6.x-1.1 Date 2009-Jun-22 Size 116.08 KB Links Download Release notes Status Recommended for 6.x
Additional modules: You may also want to enable the path module at this point if it's not already enabled. This will enable translated content to be found more easily.
Note the warning about setting the default language. It is important that you decide this early. See the note in the discussion about translating user defined strings (at the bottom of the page). Once you've added all the languages go to Configure and select the desire language negotiation settings. If you are not sure try "Path Prefix Only". This will allow the language to be selected by a prefix in the url. Example: "/de/contact" sets presentation language to German based on the use of "de" within the path.
If the "Translate" tab is not available for your content then the language for the content is probably set to "Language neutral".
Creating translations
This page explains how to manually enter translation using the Translate tab, created by the i18n module. If you're also using the ICanLocalize Translator module, content translation can be managed using a central Translation Dashboard and done by professional translators. Select the page you wish to translate and then select the "Translate" tab. Select add translation:
The translation has been saved and it now includes a link back to the source document.
Block settings
2) Do the same on the Spanish node that you want to be your home page and set the path url to the same value, "home" in this example.
3) Go to your Site information page /admin/settings/site-information and set the front page to the same as the URL path - "home" in this example.
Update: You may get the following warning: user warning: Duplicate entry 'home-es' for key 2 query: UPDATE url_alias SET src = 'node/126', dst = 'home', language = 'es' WHERE dst = 'home' in /home/bruce/drupal/drupal6.13/modules/path/path.module on line 108. This appears to occur if you have already used the alias before but on a language neutral page. You can try editing the url aliases directly at /admin/build/path. Search for your alias name and delete the alias if the languages is showing "All".
Adding a menu
This page explains how to manually enter menu items and translate them using the Translate tab, created by the i18n module. If you're also using the ICanLocalize Translator module, menu items will also be translated along with the node contents. We will now add a menu item to the Primary links for the default language and create translated menus for other languages. This menu will link to each language home page and display correct text for the appropriate language. There are 2 ways of doing this: 1) Edit the page and add a menu or 2) Add menus via the administration pages.
Method 1:
1) Select your home page and select "Edit" and click on "Menu settings" if they are not shown
4) Repeat the steps for the translated home page and change the menu link title to the correct translation of "Home", "Inico" for our Spanish page in this example
Method 2: Using this method we create the menus from the administration pages. 1) Navigate to http://yourdomain.com/admin/build/menu-customize/primary-links and select "Add item" 2) Create a menu for the English home page. You need to set the Path, Title and make sure you set the Language to "English"
3) Repeat for the spanish home page and set the path to the Spanish home page, the title in Spanish and set the language to "Spanish".
This is by design and only the menus for the current language will be displayed for normal users.
Setting the front page per language up Using a different domain name for each language
Setup in Drupal
1) Go to /admin/settings/language/configure and select "Domain name only" as the Language negotiation.
2) Go to the language administration page, /admin/settings/language and edit each language to include the domain name For English:
For Spanish:
Go to http://drupal.org/project/languageicons and download the module and install in your sites/all/modules directory. Navigate to the module admisistration page in your website, /admin/build/modules, and enable the "Language Icons" module listed under the "Multilanguage" section. Then save the configuration and that's it, you should now have flags in your language switcher.
Using a different domain name for each language up Block content translation
NOTE: An important point when using this method is that the default language should be English. Drupal localizes these strings with the t() function, meant to be called whenever a module outputs an English text string. Here is an example. We'll create a new block and translate its strings.
Choose where the block is displayed We'll display this block in the right sidebar. The display position doesn't really matter and the block doesn't have to be displayed in order to be translated.
Manually entering translation for the block contents The strings for the title and the body are translated using the translate interface. Go to /admin/build/translate/search and look for the strings used in the block.
Repeat for the body of the block searching for some text in the body. This should now give you a fully translated block on the Spanish home page.
Translating blocks using ICanLocalize Translator ICanLocalize Translator handles block translation using Drupal's string translation mechanism. Although internally nodes and blocks are constructed differently, ICanLocalize Translator makes their translation appear the same. Blocks will appear in the translation dashboard just like all other content types. Behind the scenes, ICanLocalize Translator will fetch the strings created by the Drupal blocks and return the translated contents as string translations. Users don't need to manually handle this as the module handles everything automatically.
Instructions for adding new translations Download and install the Localization Client module. This is required for importing new or updated translations. 1. Locate the language file you need. You can use the 'Search' box at the right hand side of the translations page. 2. Download the language pack for your version of Drupal to your Drupal root directory. 3. Extract the content of the zipped file. 4. Go to the translate interface at admin/build/translate, select "Import" and then "Reimport packages". To do this step the Localization Client module needs to be installed and activated.
Common questions
How do I remove the link to the other translation at the bottom of my page ?
You can do this from the Multilingual setup page: admin/settings/language/i18n Select "Hide content translation links".