Last updated November 23, 2008. Created by Jose Reyero on September 25, 2008.
Edited by jvandyk. Log in to edit this page.
REQUIREMENT
I need to set up a book in my site, which will be available in 2 languages. We assume that the site already has the second language installed and enabled. We will call the 2 languages 'language-1' and 'language-2'.
The user should be able to select in which language they wish to see the book, by selecting a language from the site's central language menu.
While browsing through the book, the user should be able to switch to the corresponding page in the other language, by using the site's language menu, or by selecting a language link at the bottom of the page.
The book navigation block will be displayed in the site, and all links in it should automatically translate to reflect the translated pages of the book, depending on the language currently chosen.
Step 1: Set multilingual system settings
Go to 'Site Configuration -> Multilingual System', and make sure that under "Content selection" you have "Current language and language neutral" selected. This will ensure that only content in the currently selected language, or content that is 'language-neutral', will be displayed in menus throughout the site.
Step 2: Enable translatable multilingual content for Book Page
The book is going to be entirely made up of nodes of content type 'Book Page'. So, we need to tell Drupal that we want this type of content to be language-aware, and that we want each node to be able to have corresponding 'translations'.
Go into 'Content management -> Content types -> Edit Book Page'. Under "Workflow settings", make sure that you select "Enabled, with translation", and click the button "Save content type".
Step 3: Enable and configure the "Book navigation" block
Go into 'Site building -> Blocks', and enable the "Book navigation" block - ie., set it display in an active page region, such as the left or right column of the site.
Then, click the 'configure' link for the block. In the block configuration page, make sure that under "Multilingual settings" you select "All languages". This will ensure that the block is visible regardless of the language being used to browse the site.
Last of all, under "Book navigation block display", select "Show block only on book pages". This will ensure that only the book the user is currently in will be displayed.
Click "Save block".
Step 4: Start the book in language-1
Go to 'Content management -> Create content -> Book Page', to create a new Book Page. This page will be the 'cover page' for our new book, and the page's title will define the book's title. Enter all details as required - ie., if you want a link to the book in one of your menus, specify that under "Menu settings" - including the body, in language-1.
Under "Language", make sure language-1 is selected.
Under "Book outline", select "create a new book".
Click "Save". You new book - in language-1 - has been created.
Step 5: Start the book in language-2, by translating language-1
Now, we need to start the language-2 version of the book. We do this by TRANSLATING the language-1 version of our first page.
Navigate to the first page of your book in language-1, which you just created. While you are viewing the page, next to the "View", "Edit", "Track" buttons you should see a "Translate" button. Click on it.
You are taken to a page that list all the translations for the current page. In it, you should be able to see, that there is still no translation for this page in language-2. Click the 'add translation' link.
You are now in a 'Create new Book Page' page, and you should follow the same steps described in Step 4 above. Note that the 'Language' menu is already selected for you. Under "Book outline", make sure you select "create a new book". Remember that the title of this page will be the title of the book in language-2.
Click "Save".
Step 6: Adding pages to the book in language-1
To add a page to the book in language-1, create a new book page, select the language as 'language-1', and under "Book outline" select the location in the book that this page should be. You can also create pages by navigating to an existing book page, and clicking one of the 'create' links at the bottom of the page - i.e., 'create child page', etc.
Step 7: Adding corresponding pages to the book in language-2, by translating language-1
When you want to add a corresponding, translated page to the book in language-2, navigate to the page in language-1, and click on the "Translate" button at the top. Then, click on the 'add translation' link for language-2. Set options for the new page as appropriate, and save.
Note that when you are navigating through the pages of your book, the book navigation menu displays in the current language.
Reference: http://drupal.org/node/305379
Comments
Module for this
There's a new module that solves this problem: i18n Book Navigation.
It allows to have only the book outline in language-1. Each page is then translated to language-2, but there's no need to create a new book outline - it just uses the outline of language-1, which is much simpler.
I'm on Twitter, y'all
My blog - PSD 2 Drupal