Last updated December 16, 2015. Created on September 3, 2011.
Edited by krina.soni, Francewhoa, Chris Gillis, manop. Log in to edit this page.

Note: The below article uses the older model of "Content Translation" instead of the newer model of "Entity Translation".


Introduction to "Content Translation" and related modules

Internationalization (or simply i18n) is one of Drupal's most complex module suites. It covers many different multilingual needs - so, in order to make the most of it, you have to know what you're doing.

For the beginner Drupal user, building a multilingual site seems quite straightforward, but in fact it represents a challenging task. That's because each site is based on different multilingual demands.

For instance, have you got 100% of the content in different languages? If not, will your site display content in a default language as a fallback? Does your client adopt subdomains for each language? etc.

Those are interesting use cases.

However, this guide is intended for those who can install Drupal, yet still don't know their way around i18n. We'll cover the basic setup of a multilingual site: how to display some hypothetical content in more than one language, assuming only one language is seen at all times.

We'll use two languages, each with its own footer, menu, contact form... and content. We'll also see how to keep the same image across posts, and how to organize posts in views with different paths.

Remember: whenever you see example.com, replace it with your actual domain. ;)

Requirements

In order to complete this tutorial, you must know how to:

  1. install a Drupal 7 website
  2. add modules
  3. create content
  4. customize menus
  5. create views
  6. rearrange blocks
  7. create custom blocks
  8. use the site-wide contact form

You can still read this guide if you don't know how to do one thing or another, but of course it'll impact what you can learn.

Modules

You'll need the latest version of each of the following modules. If there isn't a stable release, don't worry. It'll still work for the purpose of this tutorial.

Basic

  1. Internationalization (i18n)
  2. Pathauto (pathauto)
  3. Token (token)
  4. Transliteration (transliteration)
  5. Variable (variable)
  6. Chaos Tools (ctools)
  7. Views (views)
  8. Internationalization Views (i18nviews)
    • Note: This module is not yet available for Drupal 7 as a "Recommended release". Quality review and finalizing still pending. Your feedback app
      Recited.
  9. Localization update (l10n_update)

Optional, but handy

  1. Administration Language admin_language
  2. Administration Menu (admin_menu)
  3. Demonstration site (demo)
  4. Module Filter (module_filter)

Installing modules in Drupal 7

In case you're new to Drupal 7, you can now install modules easily by visiting example.com/admin/modules/install and entering in the textbox the address for the module you want.

For example, to install Views, go to http://drupal.org/project/views, scroll down and copy the address in the tar.gz or zip next to the appropriate version (for example, version 7.x-3.0-rc1 will have the address http://ftp.drupal.org/files/projects/views-7.x-3.0-rc1.tar.gz). Paste that link in the box and hit Install.

Note that not all web hosts support this feature; if that's your case, download and extract the module folder to example.com/sites/all/modules and you're good to go. :)

Activating modules

Required

Access example.com/admin/modules and check the following modules under each group:

  1. Core
    1. Contact
    2. Locale
    3. Content translation
  1. Chaos tool suite
    1. Chaos tools
  1. Multilingual - Internationalization
    1. Block languages
    2. Contact translation
    3. Internationalization
    4. Menu translation
    5. Multilingual content
    6. Multilingual select
    7. String translation
    8. Synchronize translations
    9. Taxonomy translation
    10. Translation sets
    11. Views translation
  1. Other
    1. Pathauto
    2. Token
    3. Transliteration
  1. Variable
    1. Variable
  1. Views
    1. Views
    2. Views UI

Optional

  1. Administration
    1. Administration Language
    2. Administration menu
    3. Administration menu Toolbar style (uncheck Toolbar in Core)
  1. Development
    1. Demonstration site
  1. Other
    1. Module filter

Basic Configuration

Date and Time

Often an overlooked detail, date and time have different formats in each country. By default, Drupal uses the format mm/dd/yyyy (month with two digits, day with two digits and year with four digits). If that's not your case, access example.com/admin/config/regional/date-time and change the date and time format to suit your needs. Remember there's three formats: Long, Medium and Short.

01.png

Add your language

In order to have a multilingual site, you have to first tell Drupal which languages your site speaks. Go to example.com/admin/config/regional/language and add your language(s) by clicking on the Add language link.

02.png

Detect your language

Back to example.com/admin/config/regional/language, click on the Detection and selection tab, on the upper right corner. You'll be taken to example.com/admin/config/regional/language/configure.

03.png

There's a list of detection methods that your site uses to display content: URL, Session, User, Browser and Default. Your needs may vary, but a basic functionality is URL. This means that when the user accesses example.com/es, they'll see content in Spanish; example.com/fr shows content in French and so on. Check the box to the right of URL and click on Save settings. Now every time a user visits example.com, they'll get content in your site's default language; example.com/ followed by any language code will show content in that language code.

Updating translation

Admin your language (optional)

Some people prefer the admin screens in one language, even though it isn't the site's default language. If that's your case, you need the Administration Language module (http://drupal.org/project/admin_language).

04.png

Enable it, then visit example.com/admin/config/regional/language. You'll notice there's two columns with radiobuttons: Default and Admin. Now you can set a language for the site and another one for the admin screens.

Node edit language

Isn't it odd that the admin screens are in one language and node edit screens in another?

If so, visit example.com/admin/config/regional/language/admin_language and click on all checkboxes. Now the admin screens will be entirely in the language of your choice: even node and user edit ones. You can also set it to any other language you prefer.

Please note that in some cases Drupal core or its modules aren't 100% translated from English.

Switching languages

Some sites leave content translation links close to the text, while others have only a block where users switch their language.

The default behavior for i18n is the former. If you'd like to change that, head over to example.com/admin/config/regional/i18n/node. In there, check Hide content translation links.

Next, you'll have to go to example.com/admin/structure/block and enable the block Language switcher (User interface text) by placing it somewhere in your theme's regions (header, footer, sidebars etc).

05.png

What if the content isn't translated?

That's easy. Visit example.com/admin/config/regional/i18n/node again and, under Default language for content types with Multilingual support disabled, choose Language neutral (Recommended).

This one is very useful when you have subtitled videos, for example. It doesn't matter which language the node is in, so just publish them as language neutral ;)

Don't worry, we'll see how to set multilingual options for content shortly, as well as how to publish content in any given language.

Content Configuration

Now that you have set the basics, it's time for the juicier bits of this tutorial. We're going to learn how to tell Drupal our content is translatable; create nodes in different languages; and organize them in views.

Translatable content

First we'll set our content to be translatable. Head on to example.com/admin/structure/types/manage/page. Once there, scroll down to the vertical tabs and click on Publishing options. Under Multilingual support, select Enabled, with translation and click on Save content type.

06.png

Now create a test page. Notice how there's a language selection dropdown: choose one. Add a title and some text and click save.

07.png

(If you need some text to fill up the space, visit http://lipsum.com.)

Look at the tabs on your page. To the right of View and Edit, there's Translate.

08.png

Click on it and you'll see a table with different languages for your node.

09.png

Choose a language to translate to and click on add translation to the right, under the Operations column. Translate your content and click Save.

URLs without accents

Many languages have accents; but, in many cases, it's not good to have URLs with them. if you want to strip accents but keep letters intact, go to example.com/admin/config/search/path/settings and check Transliterate prior to creating alias.

10.png

Then resave your content, checking Automatic alias under URL path settings. This will turn example.com/es/mi-página into example.com/es/mi-pagina. ;)

Same pic, different post

For some content types, there's no need to create a whole new node from scratch. For example, sometimes you need the same picture even though it's in a different language.

If that's your case, access example.com/admin/structure/types/manage/article; scroll down to Publishing options and, under Multilingual support choose Enabled, with translation.

Click on Save content type, but go back there (example.com/admin/structure/types/manage/article). Under Synchronize translations, check Image and click on Save content type again.

11.png

Now post some articles with images. You'll see that their translations retain the respective pictures - unless you change them ;)

Views and internationalization

By now you're probably aware that you can create several kinds of content listings with Views. but how does that play out when your site speaks different languages?

Same view, different languages

A basic usage of views and i18n is when you need one page (for instance, Blog) in which nodes vary conformed to the language the user is in.

To do that, create a basic view for your articles. Add a single page display and give it the address example.com/blog. Then, add a filter. look for Content: Language. Add it.

12.png

Under Language, select Current user's language and click Apply.

13.png

Save your view and access it. Switch languages and the nodes will display accordingly.

Different view, different language

Now create another view for your articles' images. Name it Images and select fields as row style.

14.png

Use only your articles' titles and images. Give it the address example.com/images.

Don't forget to give it the same filter as before (Content translation: Language) but choose a specific language instead.

Add another page display and give it a title that means Images in another language (let's say "Imágenes" if you speak Spanish). Give it the address example.com/imagenes, for example. Its language filter will be different, of course, so override it and change the language.

Now you have two views which display the same content, but in different addresses and languages. You must set different menu items that point to each one. But when users switch language, they must see the corresponding view - with address, page and node titles all in one language. This means menu items which are a translation of each other. How? Read on.

Extras

As a finishing touch for this tutorial, we'll set different menu items, contact forms and footers.

Menu items

In order to access the views created before, we'll add two menu items:

  1. One that points to the same place regardless of the users' language, switching content to suit: example.com/blog shows blog posts in English, example.com/es/blog shows posts in Spanish etc.
  2. Two that point to different views (Images or Imágenes), with different titles and content, one for each language.

So we'll really add three menu items, two of which are a translation of one another.

Head on to example.com/admin/structure/menu. Before we can create menu items in different languages, we must tell Drupal the menu itself is translatable. Click on the Edit menu link, to the right of Main menu.

15.png

Under Translation mode choose Translate and Localize and click Save.

16.png

To the right of Main menu, click on add link.

17.png

Give your link the title Blog and address example.com/blog. Click on Save. Repeat the process to create another link named Images which points to example.com/images - but, this time, under Language, select English.

Now edit the link Images. Click the Translate tab. To the right of your language, click on add translation.

18.png

Give it a different title and address and click Save. Now your menu is complete :)

Contact forms

Go to example.com/admin/structure/contact. You'll notice a Category named Website feedback. Click on Edit to the right.

On the following page, click on the Translate tab. Click on translate to the right of the untranslated language.

19.png

Under Category, change Website feedback to the proper translation (for example, in Spanish, type "Comentarios del sitio web"). Click on Save translation.

Repeat the above step for each of your contact form's untranslated categories. Now, whenever people visit your site, they have different contact forms whose messages can be sent to different emails.

But the title in the contact form isn't translated. For instance, in example.com/es/contact it isn't "Contacto". Now what? Easy: go to the Translate interface page in example.com/admin/config/regional/translate/translate. We'll find the right text string to translate.

20.png

Under String contains, type "Contact". There's some dropdowns here to help you refine your search; they'll save you a lot of time and effort. Select like so:

  1. Language: English (provided by Drupal)
  2. Search in: Only untranslated strings
  3. Limit search to: Built-in interface

Then click on Filter. You'll see Contact is the first result. Click on Edit to the right of it. Translate and save. Now visit your contact form in another language :)

What if I need to change the default language?

You may have a problem if you have changed the default language, for instance Drupal asking you to translate into English while the original is in English. In such a case, export the strings of this category: this creates an editable file on your local computer. In this file add the needed translations and then, from the web site, import the modified file.

Footers

In D7, you don't set a single footer like you used to. Instead, we'll create two different footer blocks, one for each language. Visit example.com/admin/structure/block/add to create the first one.

The first footer will be in English. Enter the following information:

  • Block description: "English Footer"
  • Block title: "<none>"
  • Block body: "This is my footer"

Now scroll down to Visibility settings and click on Languages. Under Show this block for these languages, choose English. Click on Save block.

21.png

Repeat the steps above to create another footer for your language. Enable them on the footer area of your theme. Voilà!

Wrapping up

Whew! If you came this far, you already know how to set some basic multilingual preferences in Drupal that should get you up to speed. But as Drupal goes, there's much more. And quite often, there's more than one solution. For example, you can try and translate that block you just created, instead of having one for each language. Give it a try! ;)

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

Andrés Chandía’s picture

Could you explain the whole process for this subject, I mean from the views creation on, because I haven't been able to achieve the expected result.

I mean for "Same view, different languages" and "Different view, different language"

Thanks a lot

@ch

luco’s picture

ok. can you please tell me what trouble are you having?

_________________________

"There is no off position on the genius switch."
- David Letterman

doomed’s picture

Yeah, that part is difficult to understand. My suggestion to the author is adding a few more screenhots. Maybe showing the end result (front-end) would help.

Fiable.biz’s picture

Hello.

The "one web" principle is that the different versions of the same content have one common URI, plus a specific URI per version. So, for one content in n languages, one gets n+1 URIs. For instance http://example.com/about would be the common URL of the content "About us", whose served version would depend on content negotiation, i.e. on the visitor, while http://example.com/about.en , http://example.com/a_propos and http://example.com/бидний_тухай (or http://example.com/about.en , http://example.com/about.fr and http://example.com/about.mn) would be the specific URIs of the English, French and Mongolian versions respectively. In most cases, the visitor doesn't need the specific URIs, and navigates between common URIs, getting automatically served the most appropriate version each time. But if he explicitly wants to (for instance to see the original version of a text), he can get a specific version, thanks to the specific URI.

This scheme is recommended by the W3C.
Is it possible to get it in Drupal? If yes, how?

It seems that it is what you do for Views, but you don't explain how to add a basic page to a menu.

Thank you in advance.

http://Fiable.biz Web site creation.

luco’s picture

when you create a basic page, there's a place at the bottom where you can define a menu link. same goes for adding translations.

as for the "one web" approach, I'm unfamiliar with it. what I do know is that you can use pathauto to generate links like [node:source:title].[node:language]. but I usually stick to the basic example.com/langcode/[node:title].

_________________________

"There is no off position on the genius switch."
- David Letterman

jovemac’s picture

After translation, will it create a seperate node or add just additional fields in the exisiting node?

AllanTheDream’s picture

Yes it does create a different node whose content one has to type into, in the given language one wants to translate the initial node to.

Twitter : AllanTheDream

Facebook : Allan Musisi Lule

Fiable.biz’s picture

This so-called basic installation how-to is not so basic and the title is misleading. Several of the "basic" modules are unnecessary to get a multi-language site, notably pathauto, transliteration, views and internationalisation views.

http://Fiable.biz Web site creation.

luco’s picture

I see.

there seems to be a misunderstanding of "basic". what I meant by it is steps to create a basic i18n site. but even within this scope a client's requirements may vary a lot.

some Drupal knowledge is indeed required. sorry for the confusion.

"However, this guide is intended for those who can install Drupal, yet still don't know their way around i18n."

hate to say I told you so. ;)

_________________________

"There is no off position on the genius switch."
- David Letterman

pio.fernandes’s picture

I am pretty sure transliteration is needed. On my D7 install, things were not working as they should: Couldn't change language (only worked for admin), and it was starting to go in the despair category. I saw the basic requirements
Internationalization
Pathauto
Token
Transliteration
Variable
Chaos Tools
Views
Internationalization Views
and I was using all except not using transliteration. Now it works as supposed. Could anyone confirm it?

silberbox’s picture

I am sad that this isnt a part of the core files of Drupal 7 or at least as an offical addon.

But the Instruction is simpl and clear. Great work! Great Module!

love it!

EDIT: One thing: As i installed all required Moduls i had two Adminbars at the Top of my page.
Had to deactivate the Drupal Adminpannel in the Coremodules. Maby a hint would be useful.

luco’s picture

thanks for the update. glad to be of service :)

_________________________

"There is no off position on the genius switch."
- David Letterman

asifnoor’s picture

Looks good. But what if i have already a site with lots of content created in english and now i want to enable support for other languages. I basically cannot ask my client to go to translate tab and translate each node.

Any modules for importing content into specific language, still maintaining relationships with english version node?

druvision’s picture

Content translation is a service, not a module.

Your client may use the services of iCanLocalize or Lionbridge which provide modules which connect you with translators. Translators are notified when there are content items which need translation as soon as they appear in your site.

digitalcnc’s picture

If I enable the Localization update (l10n_update) module then my configuration menu is not available, if I disable then everything is working perfectly.
I use drupal 7.14
I don't know if this only in my case, but I reproduced this issue twice.

luco’s picture

I'm unfamiliar with this module - what does it do?

cheers

_________________________

"There is no off position on the genius switch."
- David Letterman

dharem’s picture

How do you remove the "Language English" in the content box? it shows correct language..

yavannah’s picture

+1. I'm also trying to remove that. If anyone has any information it would be greatly aprecciated

Update: I'm not sure if you still need this, but I found the way. It's very easy and obvious xD. You go to your content type/manage display and make the language hidden.

PD: sorry for my english.

Tritof’s picture

Content types > Manage Display

Language, switch from visible to hidden.

Aptalops’s picture

Hi, just to say I found this tutorial really useful, comprehensive and clear. Thanks a lot.

yavannah’s picture

First of all, thank you! I'm a noob and this tutorial has helped me a lot.
I had a site already done and I had to make it multilingual. Everything went fine until the translation of the menu. The whole process of translation the menu was horrible and very confusing, because it keep creating nodes which names I couldn't edit.

What worked for me was translating a page and adding to that translation a link in the menu, with the name and URL that I wanted. That way the menu changes from language to language and you don't get the messy node/xx urls

tierso’s picture

Hi.

Been roaming through countless modules and doc-pages on the Drupal site not to mention all the googling, but I am yet to find ANY documentation on how to create multilingual blocks. Nor have I been able to find any module allowing the creation of multilingual blocks. And by multilingual, I'm not talking about what there are myriads of pages describing the same thing but the ability to create just ONE block, with a "block description" which changes automatically depending on default language (like the core blocks do).

So is this even possible? I even tried to grep the description for a block I had created without any luck, which I take it means the info is saved in the database and not in any file, right? And it doesn't show up as a string on the "translate interface"-page either.

Does anyone have any clue on how to (if it's possible?) replicate the behaviour of core blocks for custom blocks?

luco’s picture

I really don't know, tierso. what I do know is there in the tutorial.

have you tried the String Overrides module?

also you can enable PHP as an input filter and wrap your block text using the t() function.

good luck.

_________________________

"There is no off position on the genius switch."
- David Letterman

jwilson3’s picture

Custom block translations can be achieved using Beans and entity_translation, or using Boxes and the i18n_boxes module.

AllanTheDream’s picture

can't wait to see this service integrated into the drupal 8 core,................

Twitter : AllanTheDream

Facebook : Allan Musisi Lule

esvalot’s picture

Very clear. Thanks a lot

langweer’s picture

Maybe I am wrong or overlooked one earlier step, but I couldn't find "Content translation: language" in the filter criteria of views. I am talking about the chapter "Same views, different languages" of this wonderful and comprehensive how-to. I really appreciate the effort you made to write it.

Maybe there has been a change of labels in a recent version of the core service "Content translation". I am using D 7.15. It is a minor obstacle, but maybe someone can double-check and change the description.

I used "Content: language" and it works perfectly.

luco’s picture

so you used "Content: language" instead of "Content translation: language" and it worked like in the instructions? that's OK. it probably means there was a revision in i18n views wording. I'm not sure, because it's been a long time since I deployed a multilingual website.

I'm currently working on an intranet but it's still not live. however, I checked the views on this newer project I'm on, and it says "Content: language" as well. so no harm here :)

_________________________

"There is no off position on the genius switch."
- David Letterman

doomed’s picture

Content: language is the right option. The other one doesnt exist on current versions.

klucid’s picture

Thanks for the awesome write up. It's helped me get started with my first multi-language site.

One question... If this is the wrong place to ask please point me in the right direction. I would like comments on the content to post throughout all translations of any given content. I realize that each language is technically a separate node, but is there a way to achieve this? More importantly, I have the Rate module installed and it would be great if the average rating was applied throughout all languages. Is it possible?

luco’s picture

whoah - tough one.

if you check the DB, you'll notice every comment - and rating - applies to a specific node via NID. I'm not sure, but maybe a combination of Entity Reference and Views?

anyway, as far as interfaces are concerned, I'd say it's rather the wrong place for comments. think about it: if you're reading comments on Youtube which are in English and all of a sudden you find someone speaking, let's say, Russian, you'd feel left out... wouldn't you?

_________________________

"There is no off position on the genius switch."
- David Letterman

allenfantasy’s picture

This tutorial is really helpful -- simple, and clear.

Though I have learned most of them( which tortured me a lot), this note points me a clear thread.

Thanks dude!

vhiering’s picture

Hi, I have followed each single step carefully and at the end when setting up a filter under Views (FILTER CRITERIA, I don't see listed:

Content translation: Language

but other 3 Content translation options: Source translation, Translation set node ID, Translation status
but i see Content: Language

are they the same or am i doing something wrong?

doomed’s picture

Content: language is the right option.

guix’s picture

i18nviews seems to be dead, last commit is from July 2012. Any alternatives other than creating 1 view per language ?

JeniferTucker’s picture

Thanks for putting this together as a useful resource. Having grappled with internationalization in D6, the work you've done for D7 makes the initial configuration set up quick and easy. Lots of nice stuff there :-)

caco13’s picture

Great, great guys!

I am a new newbie on Drupal. The tutorial is simply grate!

It works fine!

Thank you all!

BigJonMX’s picture

thank you so much for this guide.

Update: I translated my menu into numerous languages as needed. nice!
Now that I've made an About page, its all gone tits-up! It seems the only option I have is to actually create many pages, which the menu cannot see. So on the basic-page I have to 'create a menu link' for reach language. Now in the Menu section I can Not have translated menus, just many many links (to the other languages).
Any advise please...

And why on earth does it say the language at the bottom of the text. D'uh!
I know what language I reading - I reading it !!!!

BigJonMX’s picture

Here's a tip:
Create a basic page in your first language, type the text and tick add a menu link
translate that page into other languages, but do NOT tick add a menu link. save the pages.

Now go over to menus and you'll see your First page listed - in this screen, translate the menu item to other languages.

It'll keep your system tidy and I think less prone to errors/confusion.

(still not clean on the page naming, and url business - I'm trying to not have node/##)

doomed’s picture

To disable the language in the bottom of each node, go to Structure > Content types, Your Content type > Manage display and change the Language field from Visible to Hidden.

chirag.shetty’s picture

Hello all,
In page views there is a header option to add node as a header of the view . as the filter only works on content . how can i make the header multilingual?

doomed’s picture

For anyone looking to learn how to use the "Translate and Localize" menu option, here's a quick video that explains it:

Create Multi-Language Menus in Drupal 7
https://www.youtube.com/watch?v=Sx9lJ_hOrCw

doomed’s picture

Yes, it is possible to display a different logo for each language with Drupal 7 and the Internationalization module.

1) Go to admin/config/regional/i18n/variable
2) Select Theme Settings on the left and then enable "Theme Settings - Logo, icons and other specific theme settings."
3) Go to your Theme and you will notice a message saying "THERE ARE MULTILINGUAL VARIABLES IN THIS FORM - Check you are editing the variables for the right Language value or select the desired Language". This means your theme can now have different settings for each language :)