It’s
very easy to build multilingual sites using Drupal. You have to just
install and configure few modules and multi-language site starts
working. Following are simple steps to localize a site in Drupal 7.
Note! urls in this tutorial like
Note! urls in this tutorial like
(admin/build/modules) means (www.ursite.com/admin/build/modules)or (localhost/ursite/admin/build/modules)- Install Internationalization module
- Go to the modules (admin/modules) and in Core section enable
- Locale
- Content translation
- Add new language from site
- Go to the Languages page
(admin/config/regional/language) - Add required languages
(admin/config/regional/language/add) - Choose edit on languages page
(admin/config/regional/language/edit/ur) - In the Language path prefix language code enter Path prefix and save language
- Make sure English is the default language
- Go to the Languages page
- Add translations
- Download and install localization update module http://drupal.org/project/l10n_update
- Enabling localization update module will get and add translation strings of all languages which you added.
- To update translations goto
(admin/config/regional/translate/update) - Click Update translations button
- Wait patiently as the module gets all your translations
- (optional, but recommended) Configure settings to get updates regularly via cron at:
(admin/settings/language/update -Drupal 6) and (admin/config/regional/language/update-Drupal 7)
- Configure language switching settings from
(admin/config/regional/language/configure) - Enable and place language switcher block on right place.
- Translate (Create and Import PO files)
- There are two types of strings which need to be translated
- Translate strings in database
- To create .po files of database strings like variables, menu, blocks i18n has feature to extract and save .po files on your system.
- Goto
(admin/config/regional/translate/export)to export database strings to .po files.
- Translate strings in code files
- To create .po files of core, community, or custom modules or theme files you will have to install Translation template extractor module ( http://drupal.org/project/potx/).
- After installing this module goto
(admin/config/regional/translate/extract). - Select file or directory and extract.
- Remember to use t() function for strings in
module\themefiles and Drupal.t() for Javascript files.
- Translate strings in database
- After extracting use tool like Poedit (http://www.poedit.net/download.php) to insert the translated strings.
- Once .po file completed with strings translated into target language just goto
(admin/config/regional/translate/import)and import the .po file.
- There are two types of strings which need to be translated
You can use https://poeditor.com/ to easily translate a website into multiple languages and improve the workflow.
ReplyDeleteThank you for a great info about website localization!
ReplyDelete