How Can We Help?
< All Topics
Print

Enabling Multilingual Capabilities in Drupal: A Step-by-Step Guide

a) How do I add languages to Drupal ?

1. First, install the four core multi-language modules (language, interface translation, and content). Translate and Configure Translation), follow the steps in the Drupal Module Installation: Step-by-Step Guide section.

2. Then, navigate to Configuration to select Region and Language, and click Languages (admin/config/regional/language) in the Manage administrative menu.

3. After that, click Add Language.

4. Next, select Spanish or your preferred language from the list and click Add Language. After downloading, you’ll be redirected to the Languages page with a confirmation message.

drupal

5. Finally, follow the steps in the Positioning a Block in a Region in Drupal: Step-by-Step Guide section to position the language switcher block in the second area of the sidebar in Drupal.

b) How do I configure content translation in Drupal ?

1. First, navigate to Configuration to select Regional and Language, and then select Content Language and Translation (admin/config/regional/content-language) in the Manage administrative menu.

2. Then, check Content, Custom Block, and Custom Menu Link to make entity types translatable under Custom Language Settings.

3. Next, configuration options for content, a custom block, and a custom menu link are available. Choose subtypes for each entity type, check Basic page for content, Basic block for custom block, and Custom menu link for menu link.

4. After that, verify the settings for the entity types as shown below:

Field name Explanation Example value
Default language Default language for entity subtypes Site’s default language(English)
Show language selector on create and edit pages Whether the language selector should be displayed during content editing and creation Checked

5. Then, select fields on the Basic page for translation, leaving unchecked if not dependent on translation. Enable field translation for accountability or implementation workflow, using numbers or dates for accountability.

Field name Explanation Example value
Title The content title Checked
Authored by The author Unchecked
Publishing status Whether the content has been published or not Checked
Authored on Publication date Unchecked
Changed Last updated date Unchecked
Promoted to front page Whether the content will be included in certain content views Unchecked
Sticky at top of lists Whether to display content first in certain content views Unchecked
URL alias Better content URL Checked
Body The main content of the page Checked

6. Next, the translatable fields in basic blocks and custom menu links should be checked for their appropriate boxes.

7. Finally, click Save Configuration.

c) How do I translate content in Drupal ?

1. First, navigate to Content in the Manage administrative menu (Admin/Content).

2. Then, enter “Home” in the title field to locate the homepage.

3. Next, select “Translate” from the drop-down button in the Home page content item row, and the homepage translation page will appear.

4. After that, click Add in the Spanish row.

Note: The user interface has been converted to Spanish.

5. Then, remove the first occurrence of es, like example.com/es/node/5/translations/add/en/es, immediately after example.com to switch back to English in a browser URL.

6. After that, fill in the fields as shown below.

Field name Explanation Example value
Title Translation of the page title Página principal
Body Translated page text Bienvenido al mercado de la ciudad – ¡el mercado de agricultores de tu barrio! Horario: Domingos de 9:00 a 14:00. Desde Abril a Septiembre Lugar: parking del Banco Trust número 1. En el centro de la ciudad
URL path settings > URL alias Translated address of web page pagina-principal

7. Next, click Save and Keep Published (this translation).

8. Finally, navigate to your website’s homepage to view the newly translated pages.

d) How do I translate configurations in Drupal ?

1. First, locate the page where you created or edited the configuration to translate a website name, as the primary language of the website is English.

2. Then, locate the “Translate” link, tab, or button on the page and click on it.

3. Next, locate a button and click on it to add translations in your desired language.

4. After that, enter the translation in the form and save it.

The translation edit form for Opinion Configuration is complex and hierarchical, unlike most configuration editing methods. For example, translating Spanish labels in a recipe view involves several steps.

1. First, navigate to Structure and select Views (Admin/Structure/Views) in the Manage administrative menu.

2. Then, find the “Recipesview and click “Translate” in the drop-down button.

3. After that, click on the Spanish row, and the Add Spanish Translation for Recipe page will appear.

4. Next, under Display, select Master display settings and click Recipe default display options. Translate the display title from “Recipes” to “Recetas.”

5. Then, go to Display, select Master Display Settings, click Recipe Default Display Options, select Exposed Form, and click Reset Options to change the text of the submit button in a recipe. Other buttons and labels don’t need translation.

6. Next, under Display, select Master Display Settings and click Recipe Default Display Options to select a filter. After that, click on the (empty) taxonomy term ID to select the “Find recipes using…public label and translate it from “Find recipes using…” to “Encontrar reetas usando…“.

7. After that, click on Save Translation.

8. Finally, navigate to the recipe page and use the language switcher block to switch to Spanish, then verify that the label has been translated.

Table of Contents