SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
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?

Mais conteúdo relacionado

Destaque

Data Visualization and Mapping using Javascript
Data Visualization and Mapping using JavascriptData Visualization and Mapping using Javascript
Data Visualization and Mapping using JavascriptMack Hardy
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupalsmithmilner
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Mack Hardy
 
Server side geo_tools_in_drupal_pnw_2012
Server side geo_tools_in_drupal_pnw_2012Server side geo_tools_in_drupal_pnw_2012
Server side geo_tools_in_drupal_pnw_2012Mack Hardy
 
Wikimaps kansallisarkisto
Wikimaps kansallisarkistoWikimaps kansallisarkisto
Wikimaps kansallisarkistoSusanna Ånäs
 
Wikimaps Wikimania 2013
Wikimaps Wikimania 2013Wikimaps Wikimania 2013
Wikimaps Wikimania 2013Susanna Ånäs
 

Destaque (6)

Data Visualization and Mapping using Javascript
Data Visualization and Mapping using JavascriptData Visualization and Mapping using Javascript
Data Visualization and Mapping using Javascript
 
Behaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with DrupalBehaviour Testing and Continuous Integration with Drupal
Behaviour Testing and Continuous Integration with Drupal
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
Server side geo_tools_in_drupal_pnw_2012
Server side geo_tools_in_drupal_pnw_2012Server side geo_tools_in_drupal_pnw_2012
Server side geo_tools_in_drupal_pnw_2012
 
Wikimaps kansallisarkisto
Wikimaps kansallisarkistoWikimaps kansallisarkisto
Wikimaps kansallisarkisto
 
Wikimaps Wikimania 2013
Wikimaps Wikimania 2013Wikimaps Wikimania 2013
Wikimaps Wikimania 2013
 

Semelhante a Building Multilingual Websites in Drupal 7

Barcelona Multilanguage
Barcelona MultilanguageBarcelona Multilanguage
Barcelona Multilanguageguest3a6661
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATIONkrutitrivedi
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?nuppla
 
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?Wong Hoi Sing Edison
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 
PyTorch for Delphi - Python Data Sciences Libraries.pdf
PyTorch for Delphi - Python Data Sciences Libraries.pdfPyTorch for Delphi - Python Data Sciences Libraries.pdf
PyTorch for Delphi - Python Data Sciences Libraries.pdfEmbarcadero Technologies
 
Apache Jena Elephas and Friends
Apache Jena Elephas and FriendsApache Jena Elephas and Friends
Apache Jena Elephas and FriendsRob Vesse
 
Drupalcamp Atlanta 2010 Internationalization Presentation
Drupalcamp Atlanta 2010 Internationalization PresentationDrupalcamp Atlanta 2010 Internationalization Presentation
Drupalcamp Atlanta 2010 Internationalization PresentationMediacurrent
 
Design Web Service API by HungerStation
Design Web Service API by HungerStationDesign Web Service API by HungerStation
Design Web Service API by HungerStationArabNet ME
 
Drupal7 Theming session on the occassion of Drupal7 release party in Delhi NCR
Drupal7 Theming session on the occassion of  Drupal7 release party in Delhi NCRDrupal7 Theming session on the occassion of  Drupal7 release party in Delhi NCR
Drupal7 Theming session on the occassion of Drupal7 release party in Delhi NCRGaurav Mishra
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHPEric Johnson
 
DrupalCon Paris Muiltilingual Panel
DrupalCon Paris Muiltilingual PanelDrupalCon Paris Muiltilingual Panel
DrupalCon Paris Muiltilingual PanelDoug Green
 
Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1Matthew Barlocker
 
Drupal and the semantic web - SemTechBiz 2012
Drupal and the semantic web - SemTechBiz 2012Drupal and the semantic web - SemTechBiz 2012
Drupal and the semantic web - SemTechBiz 2012scorlosquet
 
Multilingual WordPress
Multilingual WordPressMultilingual WordPress
Multilingual WordPressMatt Smith
 
Hong Kong Drupal User Group - 2014 June 14th
Hong Kong Drupal User Group - 2014 June 14thHong Kong Drupal User Group - 2014 June 14th
Hong Kong Drupal User Group - 2014 June 14thWong Hoi Sing Edison
 
Writing multi-language documentation using Sphinx
Writing multi-language documentation using SphinxWriting multi-language documentation using Sphinx
Writing multi-language documentation using SphinxMarkus Zapke-Gründemann
 

Semelhante a Building Multilingual Websites in Drupal 7 (20)

Barcelona Multilanguage
Barcelona MultilanguageBarcelona Multilanguage
Barcelona Multilanguage
 
PHP BASIC PRESENTATION
PHP BASIC PRESENTATIONPHP BASIC PRESENTATION
PHP BASIC PRESENTATION
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?
 
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
[HKDUG] #20151017 - BarCamp 2015 - Drupal 8 is Coming! Are You Ready?
 
Introduction to Web Designing
Introduction to Web DesigningIntroduction to Web Designing
Introduction to Web Designing
 
Inside DocBlox
Inside DocBloxInside DocBlox
Inside DocBlox
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 
PyTorch for Delphi - Python Data Sciences Libraries.pdf
PyTorch for Delphi - Python Data Sciences Libraries.pdfPyTorch for Delphi - Python Data Sciences Libraries.pdf
PyTorch for Delphi - Python Data Sciences Libraries.pdf
 
Apache Jena Elephas and Friends
Apache Jena Elephas and FriendsApache Jena Elephas and Friends
Apache Jena Elephas and Friends
 
Php Vs Phyton
Php Vs PhytonPhp Vs Phyton
Php Vs Phyton
 
Drupalcamp Atlanta 2010 Internationalization Presentation
Drupalcamp Atlanta 2010 Internationalization PresentationDrupalcamp Atlanta 2010 Internationalization Presentation
Drupalcamp Atlanta 2010 Internationalization Presentation
 
Design Web Service API by HungerStation
Design Web Service API by HungerStationDesign Web Service API by HungerStation
Design Web Service API by HungerStation
 
Drupal7 Theming session on the occassion of Drupal7 release party in Delhi NCR
Drupal7 Theming session on the occassion of  Drupal7 release party in Delhi NCRDrupal7 Theming session on the occassion of  Drupal7 release party in Delhi NCR
Drupal7 Theming session on the occassion of Drupal7 release party in Delhi NCR
 
Introduction to PHP - SDPHP
Introduction to PHP - SDPHPIntroduction to PHP - SDPHP
Introduction to PHP - SDPHP
 
DrupalCon Paris Muiltilingual Panel
DrupalCon Paris Muiltilingual PanelDrupalCon Paris Muiltilingual Panel
DrupalCon Paris Muiltilingual Panel
 
Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1Your First Scala Web Application using Play 2.1
Your First Scala Web Application using Play 2.1
 
Drupal and the semantic web - SemTechBiz 2012
Drupal and the semantic web - SemTechBiz 2012Drupal and the semantic web - SemTechBiz 2012
Drupal and the semantic web - SemTechBiz 2012
 
Multilingual WordPress
Multilingual WordPressMultilingual WordPress
Multilingual WordPress
 
Hong Kong Drupal User Group - 2014 June 14th
Hong Kong Drupal User Group - 2014 June 14thHong Kong Drupal User Group - 2014 June 14th
Hong Kong Drupal User Group - 2014 June 14th
 
Writing multi-language documentation using Sphinx
Writing multi-language documentation using SphinxWriting multi-language documentation using Sphinx
Writing multi-language documentation using Sphinx
 

Último

Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 

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