Book Image

Drupal 7 Multilingual Sites

By : Kristen Pol
Book Image

Drupal 7 Multilingual Sites

By: Kristen Pol

Overview of this book

Drupal is one of the most powerful and popular PHP Content Management Systems at the moment. By making your site multilingual, you are opening the door to a whole new user base, in as many countries as you like. Use the localization and internationalization features of Drupal 7 to automatically detect where your site users are visiting from and select the content appropriate to them. The world is your oyster!Drupal 7 Multilingual Sites guides you through the wild world of localization and internationalization with practical and real-world exercises that you can apply to your own website. You will go from theory to practice and acquire the skills you need to make a user-friendly Drupal 7 site that supports multiple languages.You will follow focused chapter exercises to add multiple-language support for your user interface, content, and various parts of your site's configuration such as system variables, menus, and blocks.The latter half of the book fills in the details with step-by-step exercises for localizing the interface, the content, and the configuration. Drupal 7 Multilingual Sites will give you the knowledge and the skills necessary to configure your site to support your language needs.
Table of Contents (13 chapters)

Preface

Recent estimates show at least 1.5 million websites run on Drupal, which calculates to roughly two percent of all sites. Drupal is used to create personal, business, government, and educational websites including high-profile ones such as whitehouse.gov, duke.edu, and economist.com. Drupal adoption is following a very positive trend; last year alone, the number of Drupal websites increased by more than 33 percent.

Drupal's default installation is in English. But, as you'll soon see, it can be configured to handle other languages as well. Creating a multilingual website expands your audience, and studies have shown that users are more likely to buy products and services on a website when content is presented in their native language. Coupled with the fact that there are many more non-English native speakers than English native speakers, you should see the full value of creating a site that supports other languages.

After working through the book exercises, you will have the skills needed to create a rich and robust multilingual Drupal 7 website. Enjoy!

What this book covers

Chapter 1, Multilingual Overview, Use Cases, and Modules, starts by exploring issues, considerations, and example use cases for multilingual websites. Then, to get more familiar with the topic, technical terminology, a Drupal architecture overview, and a preview of Drupal 7 modules are covered.

Chapter 2, Setting up the Basics: Languages, UI Translation, and System Settings, gets us set up with a test site, so new languages can be added and detected. With languages in place, the chapter addresses Drupal interface and string translation as well as general system configuration such as countries, dates, and variables.

Chapter 3, Working with Content, is dedicated to handling content translation using two different methods, namely, node translation and field translation. Use cases, trade-offs, and issues are discussed for both methods. The chapter includes how to work with built-in content pages such as the default home page.

Chapter 4, Configuring Blocks, Menus, Taxonomy, and Views, deals with configuring these standard Drupal components. Language-independent, language-specific, and multilingual configurations are handled, and implications of node-translated versus field-translated content are discussed.

Chapter 5, Panels, SEO, and More!, goes into advanced topics including Panels, SEO, translation management, theming, and module development.

Appendix, Modules, Resources, and Getting Involved, provides a list of modules used in the book as well as additional multilingual modules and a handy overview table on key module usage. Other resources provided include online documentation, forums, ways to get involved, and plans for Drupal 8.

What you need for this book

For the book exercises, you will need to choose from the following options:

  • Use an existing Drupal 7 website

  • Create a Drupal 7 website from scratch (drupal.org/project/drupal)

  • Use the Localized Drupal Distribution (drupal.org/project/ l10n_install)

  • Use the demo installation profile (drupal.org/project/ multilingual_book_demo)

Who this book is for

If you know the Drupal basics (such as creating content types, blocks, and menus) and want to create a multilingual website for yourself, your company, or your clients, then this book is for you. This book was beta tested by a few "newbie" Drupalers and they were able to go through the exercises without much difficulty.

This book is also very valuable for experienced Drupalers who are new to creating multilingual websites. There are many things to configure and the online documentation is scattered and incomplete. By working through this book, you will learn the intricacies of setting up a multilingual Drupal site, which will save you a lot of time and headache.

Before you start

You are highly encouraged to read this section before you continue with Chapter 1,Multilingual Overview, Use Cases, and Modules.

Exercise workflow tips

The book is written as a step-by-step tutorial. It is best to work through the exercises in order. If you do jump ahead, just keep in mind that you might need to install and configure additional modules that were addressed in earlier exercises.

It is also recommended that you disable the Overlay module when working through the exercises for a simpler workflow. In many cases, you will need to flush all caches after each configuration to ensure the system is using the latest settings. When something doesn't work as expected, flush the caches and check again.

Working with modules

The module versions used for the book exercises are listed on the demo installation profile project page (drupal.org/project/multilingual_book_demo). These versions are bundled with the demo installation profile software. But, you do not need to use the installation profile to work through the book exercises. If you use different versions of the modules, just remember that you might experience different behavior than what is shown in the book exercises. If any functionality changes drastically, then notes will be added to the errata at kristen.org/errata.

The Drupal Internationalization module, used heavily in the book, is a package of many submodules. If an exercise explains installing a module from the Internationalization package, then you only need to download the package once but you'll still need to enable the submodule that is listed.

Extra topics

A few topics that were not included in the book due to space constraints are available at kristen.org/extra, so you are encouraged to look there before diving into the chapters. In particular, there is a very useful table for seeing how to access the various translation features at kristen.org/accesstable.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Drupal requires modules and themes to use the t() function for text that will be displayed in the UI."

A block of code is set as follows:

$conf['locale_custom_strings_en'][''] = array(
'Taxonomy' => 'Categories',
'Taxonomy term' => 'Category term',
);

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

if (function_exists('i18n_string')) {
$name = i18n_string($key, $name);

}

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Click on Save".

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book — what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title through the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books — maybe a mistake in the text or the code — we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website, or added to any list of existing errata, under the Errata section of that title.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.