SlideShare a Scribd company logo
Building Multilingual Websites
in Drupal 7
Robin Puga
Language embodies the intellectual wealth
of the people who use it. ~ Kenneth Hale
Overview
● Covering the basics
● Multilingual websites in Drupal 7
● Working with translators
● What’s happening in Drupal 8
http://affinitybridge.com
Basics
● Gettext is an internationalization (i18n)
system used for writing multilingual programs
● Drupal Code
$str = t("My name is @name.n", array('@name' => $user->name));
● fr.po file
#: src/name.module:36
msgid "My name is @name.n"
msgstr "Je m'appelle @name.n"
http://affinitybridge.com
Blasts in the past - Drupal 5 & 6
http://affinitybridge.comhttp://s.coop/d6convertlang
Drupal 7
● Definitive Guide by Gábor Hojtsy
http://hojtsy.hu/multilingual-drupal7
Read it!
● Books
Drupal 7 Multilingual Sites
By Kristen Pol
http://affinitybridge.com
Drupal 7
● University of Ottawa Calendar
http://uocal.uottawa.ca
English / French
● Participedia
http://Participedia.net
English then German
http://affinitybridge.com
Modules for Drupal 7
● Locale module in core
● Internationalization or i18n module
● Localization Update module
● Entity Translation module
http://affinitybridge.com
Setup for Multiple Languages
● Add languages
● Import the .po files
● Configure detection and selection
● Configure your site content types
http://affinitybridge.com
Node level translations
● Now using Entity Translation module
● Setting up the content type
● Synchronizing fields
● Translating content using translate tab
●
http://affinitybridge.com
Entity translations
● Allows translations for entities in Drupal
● User accounts fields
● Comments
● Any entities
http://affinitybridge.com
Field level translations
● One node with translatable fields
● Use case: Products in Commerce
http://affinitybridge.com
Other Modules for Drupal 7
● Variable module
● Translation Table module
● Potx module
● Localization Client module
● Translation Helpers module http://affinitybridge.com
Translating your site
● Menus
● Same page hierarchy - translate menu links
● Different page hierarchy options:
● One menu per language, or
● Add menu links in different languages
● Blocks
● Now translatable. Works great for static blocks
http://affinitybridge.com
Translating your site
● Taxonomy terms
● Localize - one term with translated title
● Translate - different terms per language
● Views
● Filter content by user language
● Translate view titles via Translation Interface
http://affinitybridge.com
Translation Interface
● Overview
● Translation Table
● Translate - find strings & translate them
● Import - import .po files
● Strings - refresh translation strings
● Update - grabs po files and updates strings
● Export - export po files from db strings
● Extract - export po files from code files
http://affinitybridge.com
Potential Pitfalls
● Indexing in Solr
● Index language fields and filter views by language
fields.
● Adding new language to existing site
● Synchronized fields created in English that have
translations added later can cause problems.
●
http://affinitybridge.com
Code Example
Grab this install profile for En/Fr with tools:
https://github.com/robinpuga/multilang
drush make --working-copy
--translations=fr stub.make ../multilang_site
http://affinitybridge.com
● Translation workflows offline
○ Working with .po files
○ Can be difficult to understand string context
■ “Home” = house or homepage
● Translation workflows online
○ Localization Client
○ Access to Translation Tools
○ Identifying content that needs translation
Working with Translators
http://affinitybridge.com
Basics
● Gettext is an internationalization (i18n)
system used for writing multilingual programs
● Drupal Code
$str = t("My name is @name.n", array('@name' => $user->name));
● fr.po file
#: src/name.module:36
msgid "My name is @name.n"
msgstr "Je m'appelle @name.n"
http://affinitybridge.com
.Po files beyond the basics
● Translation Contexts
$str = t("Home", array(), array('context' => 'Navigation');
● Plural strings
// These strings are run through the t() function.
$str = format_plural($count, ‘1 comment‘, ‘@count comments’);
● fr.po file for plurals
#: src/name.module:36
msgid "1 comment"
msgid_plural "@count comments"
msgstr[0] "1 commentaire"
msgstr[1] "@count commentaires"
http://affinitybridge.com
What’s happening in Drupal 8
● Much more in core
● Much of i18n functionality rolled into core
● Better language detection and config
● Name transliteration for machine names
http://affinitybridge.com
Where to find more info & support
● Follow Gábor - http://hojtsy.hu/
● https://localize.drupal.org/news
● https://groups.drupal.org/internationalization
● #drupal-i18n (i18n = internationalization)
● #drupal-l10n (l10n = localization)
http://affinitybridge.com
robin@affinitybridge.com
Questions?

More Related Content

PDF
Challenge: convert policy doc from docbook to sphinx
Hideki Yamane
 
PDF
Introduction to PHP (SDPHP)
Eric Johnson
 
PDF
201510 odn-itapa
Comsode - FP7 project
 
PDF
ODN - Technical introduction of the platform
Comsode - FP7 project
 
PDF
Improving the MODX Documentation - March 29, 2019
Mark Hamstra
 
PDF
Object Oriented Programming with Laravel - Session 1
Shahrzad Peyman
 
PPTX
Moving from Publican to Read The Docs
Sebastien Goasguen
 
PPT
Php Community
Ligaya Turmelle
 
Challenge: convert policy doc from docbook to sphinx
Hideki Yamane
 
Introduction to PHP (SDPHP)
Eric Johnson
 
201510 odn-itapa
Comsode - FP7 project
 
ODN - Technical introduction of the platform
Comsode - FP7 project
 
Improving the MODX Documentation - March 29, 2019
Mark Hamstra
 
Object Oriented Programming with Laravel - Session 1
Shahrzad Peyman
 
Moving from Publican to Read The Docs
Sebastien Goasguen
 
Php Community
Ligaya Turmelle
 

Viewers also liked (6)

PDF
Data Visualization and Mapping using Javascript
Mack Hardy
 
PDF
Behaviour Testing and Continuous Integration with Drupal
smithmilner
 
PDF
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Mack Hardy
 
PPT
Server side geo_tools_in_drupal_pnw_2012
Mack Hardy
 
PDF
Wikimaps kansallisarkisto
Susanna Ånäs
 
PDF
Wikimaps Wikimania 2013
Susanna Ånäs
 
Data Visualization and Mapping using Javascript
Mack Hardy
 
Behaviour Testing and Continuous Integration with Drupal
smithmilner
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Mack Hardy
 
Server side geo_tools_in_drupal_pnw_2012
Mack Hardy
 
Wikimaps kansallisarkisto
Susanna Ånäs
 
Wikimaps Wikimania 2013
Susanna Ånäs
 
Ad

Similar to Building Multilingual Websites in Drupal 7 (20)

PDF
Barcelona Multilanguage
guest3a6661
 
ODP
PHP BASIC PRESENTATION
krutitrivedi
 
PDF
Drupal + composer = new love !?
nuppla
 
PDF
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
Wong Hoi Sing Edison
 
PDF
Introduction to Web Designing
Kailaash Balachandran
 
PDF
Inside DocBlox
Mike van Riel
 
PDF
Efficient development workflows with composer
nuppla
 
PDF
PyTorch for Delphi - Python Data Sciences Libraries.pdf
Embarcadero Technologies
 
PPTX
Apache Jena Elephas and Friends
Rob Vesse
 
PPTX
Php Vs Phyton
Francis Guison
 
PPTX
Drupalcamp Atlanta 2010 Internationalization Presentation
Mediacurrent
 
PDF
Design Web Service API by HungerStation
ArabNet ME
 
PDF
Drupal7 Theming session on the occassion of Drupal7 release party in Delhi NCR
Gaurav Mishra
 
PPT
Introduction to PHP - SDPHP
Eric Johnson
 
PPT
DrupalCon Paris Muiltilingual Panel
Doug Green
 
PPTX
Unit 5-PHP Declaring variables, data types, array, string, operators, Expres...
DRambabu3
 
PDF
Your First Scala Web Application using Play 2.1
Matthew Barlocker
 
PDF
Drupal and the semantic web - SemTechBiz 2012
scorlosquet
 
PDF
Multilingual WordPress
Matt Smith
 
ODP
Hong Kong Drupal User Group - 2014 June 14th
Wong Hoi Sing Edison
 
Barcelona Multilanguage
guest3a6661
 
PHP BASIC PRESENTATION
krutitrivedi
 
Drupal + composer = new love !?
nuppla
 
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
Wong Hoi Sing Edison
 
Introduction to Web Designing
Kailaash Balachandran
 
Inside DocBlox
Mike van Riel
 
Efficient development workflows with composer
nuppla
 
PyTorch for Delphi - Python Data Sciences Libraries.pdf
Embarcadero Technologies
 
Apache Jena Elephas and Friends
Rob Vesse
 
Php Vs Phyton
Francis Guison
 
Drupalcamp Atlanta 2010 Internationalization Presentation
Mediacurrent
 
Design Web Service API by HungerStation
ArabNet ME
 
Drupal7 Theming session on the occassion of Drupal7 release party in Delhi NCR
Gaurav Mishra
 
Introduction to PHP - SDPHP
Eric Johnson
 
DrupalCon Paris Muiltilingual Panel
Doug Green
 
Unit 5-PHP Declaring variables, data types, array, string, operators, Expres...
DRambabu3
 
Your First Scala Web Application using Play 2.1
Matthew Barlocker
 
Drupal and the semantic web - SemTechBiz 2012
scorlosquet
 
Multilingual WordPress
Matt Smith
 
Hong Kong Drupal User Group - 2014 June 14th
Wong Hoi Sing Edison
 
Ad

Recently uploaded (20)

PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 

Building Multilingual Websites in Drupal 7

  • 1. Building Multilingual Websites in Drupal 7 Robin Puga Language embodies the intellectual wealth of the people who use it. ~ Kenneth Hale
  • 2. Overview ● Covering the basics ● Multilingual websites in Drupal 7 ● Working with translators ● What’s happening in Drupal 8 http://affinitybridge.com
  • 3. Basics ● Gettext is an internationalization (i18n) system used for writing multilingual programs ● Drupal Code $str = t("My name is @name.n", array('@name' => $user->name)); ● fr.po file #: src/name.module:36 msgid "My name is @name.n" msgstr "Je m'appelle @name.n" http://affinitybridge.com
  • 4. Blasts in the past - Drupal 5 & 6 http://affinitybridge.comhttp://s.coop/d6convertlang
  • 5. Drupal 7 ● Definitive Guide by Gábor Hojtsy http://hojtsy.hu/multilingual-drupal7 Read it! ● Books Drupal 7 Multilingual Sites By Kristen Pol http://affinitybridge.com
  • 6. Drupal 7 ● University of Ottawa Calendar http://uocal.uottawa.ca English / French ● Participedia http://Participedia.net English then German http://affinitybridge.com
  • 7. Modules for Drupal 7 ● Locale module in core ● Internationalization or i18n module ● Localization Update module ● Entity Translation module http://affinitybridge.com
  • 8. Setup for Multiple Languages ● Add languages ● Import the .po files ● Configure detection and selection ● Configure your site content types http://affinitybridge.com
  • 9. Node level translations ● Now using Entity Translation module ● Setting up the content type ● Synchronizing fields ● Translating content using translate tab ● http://affinitybridge.com
  • 10. Entity translations ● Allows translations for entities in Drupal ● User accounts fields ● Comments ● Any entities http://affinitybridge.com
  • 11. Field level translations ● One node with translatable fields ● Use case: Products in Commerce http://affinitybridge.com
  • 12. Other Modules for Drupal 7 ● Variable module ● Translation Table module ● Potx module ● Localization Client module ● Translation Helpers module http://affinitybridge.com
  • 13. Translating your site ● Menus ● Same page hierarchy - translate menu links ● Different page hierarchy options: ● One menu per language, or ● Add menu links in different languages ● Blocks ● Now translatable. Works great for static blocks http://affinitybridge.com
  • 14. Translating your site ● Taxonomy terms ● Localize - one term with translated title ● Translate - different terms per language ● Views ● Filter content by user language ● Translate view titles via Translation Interface http://affinitybridge.com
  • 15. Translation Interface ● Overview ● Translation Table ● Translate - find strings & translate them ● Import - import .po files ● Strings - refresh translation strings ● Update - grabs po files and updates strings ● Export - export po files from db strings ● Extract - export po files from code files http://affinitybridge.com
  • 16. Potential Pitfalls ● Indexing in Solr ● Index language fields and filter views by language fields. ● Adding new language to existing site ● Synchronized fields created in English that have translations added later can cause problems. ● http://affinitybridge.com
  • 17. Code Example Grab this install profile for En/Fr with tools: https://github.com/robinpuga/multilang drush make --working-copy --translations=fr stub.make ../multilang_site http://affinitybridge.com
  • 18. ● Translation workflows offline ○ Working with .po files ○ Can be difficult to understand string context ■ “Home” = house or homepage ● Translation workflows online ○ Localization Client ○ Access to Translation Tools ○ Identifying content that needs translation Working with Translators http://affinitybridge.com
  • 19. Basics ● Gettext is an internationalization (i18n) system used for writing multilingual programs ● Drupal Code $str = t("My name is @name.n", array('@name' => $user->name)); ● fr.po file #: src/name.module:36 msgid "My name is @name.n" msgstr "Je m'appelle @name.n" http://affinitybridge.com
  • 20. .Po files beyond the basics ● Translation Contexts $str = t("Home", array(), array('context' => 'Navigation'); ● Plural strings // These strings are run through the t() function. $str = format_plural($count, ‘1 comment‘, ‘@count comments’); ● fr.po file for plurals #: src/name.module:36 msgid "1 comment" msgid_plural "@count comments" msgstr[0] "1 commentaire" msgstr[1] "@count commentaires" http://affinitybridge.com
  • 21. What’s happening in Drupal 8 ● Much more in core ● Much of i18n functionality rolled into core ● Better language detection and config ● Name transliteration for machine names http://affinitybridge.com
  • 22. Where to find more info & support ● Follow Gábor - http://hojtsy.hu/ ● https://localize.drupal.org/news ● https://groups.drupal.org/internationalization ● #drupal-i18n (i18n = internationalization) ● #drupal-l10n (l10n = localization) http://affinitybridge.com