SlideShare uma empresa Scribd logo
1 de 25
Baixar para ler offline
Multi-Language Websites
                    in ExpressionEngine




Originally presented at Engine Summit - The online ExpressionEngine Summit March, 30th 2010 by John Henry Donovan
Introduction
John Henry tackles this popular topic of multi-language websites
developed in ExpressionEngine. He discusses the practicalities of client
profiling and technical approaches. He shows what is possible out of the
box and how to extend functionality using some of the popular add-ons
available. Each approach and technique will hopefully deliver a wealth
of ideas and tips that should give you a head start when building your
first multi-lingual website in ExpressionEngine.




Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie   PAGE 2
Profiling

  • What does your client want from a multi-language website?

  • Who will be updating the website?

  • Do they need the ability to add more languages?

  • What type of domain are we working with?

  • What type of multi-language website is needed?




                                                                       Client Ability and needs
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie     PAGE 3
Profiling
Deciding on the type of website is a very simple step which is often
forgotten when developing a multi-language website. There are in fact 2
different types of websites you can choose from.


                                                        Versions
                                           Multiple translated versions


                                                 Translations
                                     1 version and multiple translations


                                                                                         Type of website
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie              PAGE 4
Technical Approach


http://www.domain.com/es/index.php/template_group/template/
http://www.domain.com/en/index.php/template_group/template/
http://www.domain.com/fr/index.php/template_group/template/




          system              themes              images                   en            es   fr




                                                          Domain, Segments & Folders
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie             PAGE 5
Technical Approach
                                                index.php
              es
                                                path.php
  $site_url = “http://www.domain.com/es/”;
  $site_index = “”;
  $site_404 = “”;
  $global_vars = array(
         “country_code” => “es”,
         “language” => “spanish”
  ); // This array must be associative




                                                            Global Variables & path.php
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie   PAGE 6
Technical Approach
Add the country code to all of your custom fields en_body, es_body etc.


  {exp:weblog:entries weblog=”{master_weblog}”}


     <h2 class=”title”>{if country_code != “en”}{{country_code}_title}
  {if:else}{title}{/if}</h2>


     {{country_code}_summary}


     {{country_code}_body}


  {/exp:weblog:entries}



                                                                                         Templates Tags
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie             PAGE 7
Technical Approach
http://expressionengine.com/wiki/Remove_index.php_From_URLs/



                                                                 es
          index.php                                        path.php                      .htaccess

  # rewrite rules
  RewriteEngine On


  # ditch index.php
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ /es/index.php/$1 [L]


                                                                                           .htaccess
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie           PAGE 8
Structure (Third Party Add-on)


    “
             Structure is a different way to build ExpressionEngine sites.
             It forgoes the current template_group/template setup
             and creates‘static’ and ‘listing’ pages that are all editable
             through a tree sitemap view.
            http://buildwithstructure.com/




Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie   PAGE 9
Structure (Third Party Add-on)




                                                       Alternative Languages Setup
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie   PAGE 10
Structure (Third Party Add-on)
     http://www.mydomain.com/es/index.php




     http://www.mydomain.com/es/about/




                                                                           Structure Tab Settings
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie       PAGE 11
Structure (Third Party Add-on)


  {if segment_1                  ‘es’ OR segment_1                      ‘fr’}
     {!-- START FROM SEGMENT 2 IF NOT DEFAULT LANGUAGE --}
     {exp:structure:nav_sub start_from=’/{segment_1}/{segment_2}’}
  {if:else}
     {!-- START FROM SEGMENT 1 IF DEFAULT LANGUAGE --}
     {exp:structure:nav_sub start_from=’/{segment_1}’}
  {/if}




                                                                          Example nav_sub code
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie    PAGE 12
LG Multi Language Pro (Third Party Add-on)
http://newism.com.au/


Developed by Leevi Graham of Newism Web design & Development.
The add-on bundle was commissioned by myself to suit a particular
client’s needs and workflow. It will hopefully be released back into the
community by Leevi.

  • Based on member group, hide unnecessary custom fields

  • Needed a way of showing the status of a translation

  • A phrase translator with separate plugin


                                                              Background & Design Brief
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie   PAGE 13
LG Multi Language Pro (Third Party Add-on)




                                                       Extension & Member Settings
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie   PAGE 14
LG Multi Language Pro (Third Party Add-on)




                                       Custom Fields & Phrase Translator
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie   PAGE 15
LG Multi Language Pro (Third Party Add-on)




                                                                                         Publish & Edit
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie            PAGE 16
LG Multi Language Pro (Third Party Add-on)
  {exp:lg_mlp:translate key=”phrase_key_1”}


  {exp:weblog:entries weblog=”{weblog_name}” limit=”1”}
          <h1>{if lg_lang == “en” || {lg_lang}_title                                      ==’’}{title}
  {if:else}{{lg_lang}_title}{/if}</h1>


                {if {lg_lang}_body                       ==’’}
                                {en_body}
                {if:else}
                                {{lg_lang}_body}
                {/if}
  {/exp:weblog:entries}



                                                                                         Code Examples
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie                   PAGE 17
LG Multi Language Pro (Third Party Add-on)




                                                                                         Structure Mashup
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie               PAGE 18
Localisation
http://code.google.com/apis/maps/documentation/#Localization



  <script src=”http://maps.google.com/maps?file=api&amp;v=2&amp;key=A
  BQIAAAAOVcwajvU2DiR3d7wTOAC9RQz9Es_Zr-eU6lD2TDm4seUBz8DBBTcpZXs91l
  DdbygrzYt7dFVZ_-4Tw&amp;hl={country_code};”
              type=”text/javascript”></script>




                                                                                         Google Maps
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie          PAGE 19
Localisation
     <script type=”text/javascript” src=”/inc/scripts/i18n/
  ui.datepicker-{country_code}.js”></script>
     <script type=”text/javascript”>
           $(function() {
           $(“#dob”).datepicker($.datepicker.regional[‘{country_code}’]);
           });
           </script>




                                                                                         jQuery UI
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie        PAGE 20
ExpressionEngine 2.0 and beyond
New publish layout feature is a translation gift in disguise!




                                                                      Member Groups & Fields
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie   PAGE 21
ExpressionEngine 2.0 and beyond
New publish layout feature is a translation gift in disguise!




                                                                            Publish Layout & Tabs
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie       PAGE 22
ExpressionEngine 2.0 and beyond
New publish layout feature is a translation gift in disguise!




                                                                                         Seperating Fields
Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie                PAGE 23
Resources
Wiki Articles
http://expressionengine.com/wiki/Multi_language_site/
http://expressionengine.com/wiki/multi-lingual_site_-_an_easy_alternative/
http://expressionengine.com/wiki/Multi_language_site_alternative/



Add-ons
http://buildwithstructure.com/
http://www.putyourlightson.net/projects/multi_language
http://publicdownloads.biberltd.com/ee_extensions/ext.bbr_langswitch.zip
http://leevigraham.com/cms-customisation/expressionengine/lg-multi-language/




Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie   PAGE 24
Go raibh maith agaibh

Mais conteúdo relacionado

Mais procurados

Agentes reactivos basados en modelos
Agentes reactivos basados en modelosAgentes reactivos basados en modelos
Agentes reactivos basados en modelosSaúl Hulse
 
Lenguaje de Restricciones de Objeto
Lenguaje de Restricciones de ObjetoLenguaje de Restricciones de Objeto
Lenguaje de Restricciones de ObjetoMauro Torres
 
Como se forma la pasiva en inglés
Como se forma la pasiva en inglésComo se forma la pasiva en inglés
Como se forma la pasiva en inglésJessica Balbuena
 
Metodologia orientada a objetos
Metodologia orientada a objetosMetodologia orientada a objetos
Metodologia orientada a objetosMariana Rodríguez
 
Arquitectura en Capas
Arquitectura en CapasArquitectura en Capas
Arquitectura en CapasHelenSaravia
 
Arquitectura de cliente-servidor de tres capas
Arquitectura de cliente-servidor de tres capasArquitectura de cliente-servidor de tres capas
Arquitectura de cliente-servidor de tres capasanibalsmit
 
Metodología orientadas a objetos
Metodología orientadas a objetosMetodología orientadas a objetos
Metodología orientadas a objetosyolandacando1
 
Ejercicios de búsqueda a Ciegas y Búsqueda informada
Ejercicios de búsqueda a Ciegas y Búsqueda informadaEjercicios de búsqueda a Ciegas y Búsqueda informada
Ejercicios de búsqueda a Ciegas y Búsqueda informadaHéctor Estigarribia
 
Modelado Orientado a Objetos
Modelado Orientado a ObjetosModelado Orientado a Objetos
Modelado Orientado a Objetosmenavi
 
MAPA CONCEPTUAL
MAPA CONCEPTUALMAPA CONCEPTUAL
MAPA CONCEPTUALMali Ma
 
Metodologias[1]
Metodologias[1]Metodologias[1]
Metodologias[1]martin8730
 
Moprosoft informe de investigación
Moprosoft informe de investigaciónMoprosoft informe de investigación
Moprosoft informe de investigaciónHoward Pernía
 
Metodología de desarrollo Cristal
Metodología de desarrollo CristalMetodología de desarrollo Cristal
Metodología de desarrollo CristalIván Cornejo
 
Tabla comparativa- metodologías de desarrollo
Tabla comparativa-  metodologías de desarrolloTabla comparativa-  metodologías de desarrollo
Tabla comparativa- metodologías de desarrolloitsarellano
 
Ejemplos de proyectos al modelo en cascada
Ejemplos de proyectos  al modelo en cascadaEjemplos de proyectos  al modelo en cascada
Ejemplos de proyectos al modelo en cascadaaics-1986-13-saraguro
 

Mais procurados (20)

Modelo cascada
Modelo cascadaModelo cascada
Modelo cascada
 
Agentes reactivos basados en modelos
Agentes reactivos basados en modelosAgentes reactivos basados en modelos
Agentes reactivos basados en modelos
 
Lenguaje de Restricciones de Objeto
Lenguaje de Restricciones de ObjetoLenguaje de Restricciones de Objeto
Lenguaje de Restricciones de Objeto
 
Como se forma la pasiva en inglés
Como se forma la pasiva en inglésComo se forma la pasiva en inglés
Como se forma la pasiva en inglés
 
Metodologia orientada a objetos
Metodologia orientada a objetosMetodologia orientada a objetos
Metodologia orientada a objetos
 
Arquitectura en Capas
Arquitectura en CapasArquitectura en Capas
Arquitectura en Capas
 
Arquitectura de cliente-servidor de tres capas
Arquitectura de cliente-servidor de tres capasArquitectura de cliente-servidor de tres capas
Arquitectura de cliente-servidor de tres capas
 
Metodología orientadas a objetos
Metodología orientadas a objetosMetodología orientadas a objetos
Metodología orientadas a objetos
 
Busqueda por profundidad iterativa
Busqueda por profundidad iterativaBusqueda por profundidad iterativa
Busqueda por profundidad iterativa
 
Ejercicios de búsqueda a Ciegas y Búsqueda informada
Ejercicios de búsqueda a Ciegas y Búsqueda informadaEjercicios de búsqueda a Ciegas y Búsqueda informada
Ejercicios de búsqueda a Ciegas y Búsqueda informada
 
Modelado Orientado a Objetos
Modelado Orientado a ObjetosModelado Orientado a Objetos
Modelado Orientado a Objetos
 
Linkers And Loaders
Linkers And LoadersLinkers And Loaders
Linkers And Loaders
 
MAPA CONCEPTUAL
MAPA CONCEPTUALMAPA CONCEPTUAL
MAPA CONCEPTUAL
 
Modelos de Color
Modelos de ColorModelos de Color
Modelos de Color
 
Metodologias[1]
Metodologias[1]Metodologias[1]
Metodologias[1]
 
Moprosoft informe de investigación
Moprosoft informe de investigaciónMoprosoft informe de investigación
Moprosoft informe de investigación
 
Metodología de desarrollo Cristal
Metodología de desarrollo CristalMetodología de desarrollo Cristal
Metodología de desarrollo Cristal
 
Tabla comparativa- metodologías de desarrollo
Tabla comparativa-  metodologías de desarrolloTabla comparativa-  metodologías de desarrollo
Tabla comparativa- metodologías de desarrollo
 
MongoDB
MongoDBMongoDB
MongoDB
 
Ejemplos de proyectos al modelo en cascada
Ejemplos de proyectos  al modelo en cascadaEjemplos de proyectos  al modelo en cascada
Ejemplos de proyectos al modelo en cascada
 

Semelhante a Multi-Language Websites in ExpressionEngine

wcdk - Making your WordPress Multilingual
wcdk - Making your WordPress Multilingualwcdk - Making your WordPress Multilingual
wcdk - Making your WordPress MultilingualAmit Kvint
 
Hello, meet Hola! Design for mixed-language interfaces
Hello, meet Hola! Design for mixed-language interfacesHello, meet Hola! Design for mixed-language interfaces
Hello, meet Hola! Design for mixed-language interfacesDesign for Context
 
WordPress Internationalization, Localization and Multilingual - Do It Right
WordPress Internationalization, Localization and Multilingual - Do It RightWordPress Internationalization, Localization and Multilingual - Do It Right
WordPress Internationalization, Localization and Multilingual - Do It RightDat Hoang
 
Writing Multilingual Plugins and Themes - WCMIA 2016
Writing Multilingual Plugins and Themes - WCMIA 2016Writing Multilingual Plugins and Themes - WCMIA 2016
Writing Multilingual Plugins and Themes - WCMIA 2016johnpbloch
 
Building Multilingual Sites in Drupal 7 by Yoni Steingiesser
Building Multilingual Sites in Drupal 7 by Yoni SteingiesserBuilding Multilingual Sites in Drupal 7 by Yoni Steingiesser
Building Multilingual Sites in Drupal 7 by Yoni SteingiesserJonathan Steingiesser
 
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...Suzanne Dergacheva
 
WordPress Multilingual: Benefits and Considerations
WordPress Multilingual: Benefits and ConsiderationsWordPress Multilingual: Benefits and Considerations
WordPress Multilingual: Benefits and ConsiderationsDat Hoang
 
really really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesreally really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesGiulio De Donato
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldSkills Matter
 
One App, Multiple Platforms
One App, Multiple PlatformsOne App, Multiple Platforms
One App, Multiple PlatformsMike Hartington
 
webdevelopment-210628031421.pdf
webdevelopment-210628031421.pdfwebdevelopment-210628031421.pdf
webdevelopment-210628031421.pdfDakshPratapSingh1
 
Multilingual Improvements for Drupal 8
Multilingual Improvements for Drupal 8Multilingual Improvements for Drupal 8
Multilingual Improvements for Drupal 8Acquia
 
Building Multilingual Websites with Drupal (DrupalCamp Brighton)
Building Multilingual Websites with Drupal (DrupalCamp Brighton)Building Multilingual Websites with Drupal (DrupalCamp Brighton)
Building Multilingual Websites with Drupal (DrupalCamp Brighton)Cogapp
 
Building multilingual websites with drupal
Building multilingual websites with drupalBuilding multilingual websites with drupal
Building multilingual websites with drupalSam Murray
 
Programming language
Programming languageProgramming language
Programming languageDhani Ahmad
 
Multilingual WordPress
Multilingual WordPressMultilingual WordPress
Multilingual WordPressMatt Smith
 
ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0Istanbul Tech Talks
 
Everything multilingual in Drupal 8 (2015 November)
Everything multilingual in Drupal 8 (2015 November)Everything multilingual in Drupal 8 (2015 November)
Everything multilingual in Drupal 8 (2015 November)Gábor Hojtsy
 
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Heiko Behrens
 

Semelhante a Multi-Language Websites in ExpressionEngine (20)

wcdk - Making your WordPress Multilingual
wcdk - Making your WordPress Multilingualwcdk - Making your WordPress Multilingual
wcdk - Making your WordPress Multilingual
 
Hello, meet Hola! Design for mixed-language interfaces
Hello, meet Hola! Design for mixed-language interfacesHello, meet Hola! Design for mixed-language interfaces
Hello, meet Hola! Design for mixed-language interfaces
 
WordPress Internationalization, Localization and Multilingual - Do It Right
WordPress Internationalization, Localization and Multilingual - Do It RightWordPress Internationalization, Localization and Multilingual - Do It Right
WordPress Internationalization, Localization and Multilingual - Do It Right
 
Writing Multilingual Plugins and Themes - WCMIA 2016
Writing Multilingual Plugins and Themes - WCMIA 2016Writing Multilingual Plugins and Themes - WCMIA 2016
Writing Multilingual Plugins and Themes - WCMIA 2016
 
Building Multilingual Sites in Drupal 7 by Yoni Steingiesser
Building Multilingual Sites in Drupal 7 by Yoni SteingiesserBuilding Multilingual Sites in Drupal 7 by Yoni Steingiesser
Building Multilingual Sites in Drupal 7 by Yoni Steingiesser
 
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...
 
WordPress Multilingual: Benefits and Considerations
WordPress Multilingual: Benefits and ConsiderationsWordPress Multilingual: Benefits and Considerations
WordPress Multilingual: Benefits and Considerations
 
really really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfacesreally really really awesome php application with bdd behat and iterfaces
really really really awesome php application with bdd behat and iterfaces
 
Progressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source worldProgressive f# tutorials nyc don syme on keynote f# in the open source world
Progressive f# tutorials nyc don syme on keynote f# in the open source world
 
One App, Multiple Platforms
One App, Multiple PlatformsOne App, Multiple Platforms
One App, Multiple Platforms
 
Web development
Web developmentWeb development
Web development
 
webdevelopment-210628031421.pdf
webdevelopment-210628031421.pdfwebdevelopment-210628031421.pdf
webdevelopment-210628031421.pdf
 
Multilingual Improvements for Drupal 8
Multilingual Improvements for Drupal 8Multilingual Improvements for Drupal 8
Multilingual Improvements for Drupal 8
 
Building Multilingual Websites with Drupal (DrupalCamp Brighton)
Building Multilingual Websites with Drupal (DrupalCamp Brighton)Building Multilingual Websites with Drupal (DrupalCamp Brighton)
Building Multilingual Websites with Drupal (DrupalCamp Brighton)
 
Building multilingual websites with drupal
Building multilingual websites with drupalBuilding multilingual websites with drupal
Building multilingual websites with drupal
 
Programming language
Programming languageProgramming language
Programming language
 
Multilingual WordPress
Multilingual WordPressMultilingual WordPress
Multilingual WordPress
 
ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0ITT 2014 - Matt Brenner- Localization 2.0
ITT 2014 - Matt Brenner- Localization 2.0
 
Everything multilingual in Drupal 8 (2015 November)
Everything multilingual in Drupal 8 (2015 November)Everything multilingual in Drupal 8 (2015 November)
Everything multilingual in Drupal 8 (2015 November)
 
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
Plattformübergreifende App-Entwicklung (ein Vergleich) - MobileTechCon 2010
 

Multi-Language Websites in ExpressionEngine

  • 1. Multi-Language Websites in ExpressionEngine Originally presented at Engine Summit - The online ExpressionEngine Summit March, 30th 2010 by John Henry Donovan
  • 2. Introduction John Henry tackles this popular topic of multi-language websites developed in ExpressionEngine. He discusses the practicalities of client profiling and technical approaches. He shows what is possible out of the box and how to extend functionality using some of the popular add-ons available. Each approach and technique will hopefully deliver a wealth of ideas and tips that should give you a head start when building your first multi-lingual website in ExpressionEngine. Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 2
  • 3. Profiling • What does your client want from a multi-language website? • Who will be updating the website? • Do they need the ability to add more languages? • What type of domain are we working with? • What type of multi-language website is needed? Client Ability and needs Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 3
  • 4. Profiling Deciding on the type of website is a very simple step which is often forgotten when developing a multi-language website. There are in fact 2 different types of websites you can choose from. Versions Multiple translated versions Translations 1 version and multiple translations Type of website Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 4
  • 5. Technical Approach http://www.domain.com/es/index.php/template_group/template/ http://www.domain.com/en/index.php/template_group/template/ http://www.domain.com/fr/index.php/template_group/template/ system themes images en es fr Domain, Segments & Folders Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 5
  • 6. Technical Approach index.php es path.php $site_url = “http://www.domain.com/es/”; $site_index = “”; $site_404 = “”; $global_vars = array( “country_code” => “es”, “language” => “spanish” ); // This array must be associative Global Variables & path.php Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 6
  • 7. Technical Approach Add the country code to all of your custom fields en_body, es_body etc. {exp:weblog:entries weblog=”{master_weblog}”} <h2 class=”title”>{if country_code != “en”}{{country_code}_title} {if:else}{title}{/if}</h2> {{country_code}_summary} {{country_code}_body} {/exp:weblog:entries} Templates Tags Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 7
  • 8. Technical Approach http://expressionengine.com/wiki/Remove_index.php_From_URLs/ es index.php path.php .htaccess # rewrite rules RewriteEngine On # ditch index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /es/index.php/$1 [L] .htaccess Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 8
  • 9. Structure (Third Party Add-on) “ Structure is a different way to build ExpressionEngine sites. It forgoes the current template_group/template setup and creates‘static’ and ‘listing’ pages that are all editable through a tree sitemap view. http://buildwithstructure.com/ Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 9
  • 10. Structure (Third Party Add-on) Alternative Languages Setup Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 10
  • 11. Structure (Third Party Add-on) http://www.mydomain.com/es/index.php http://www.mydomain.com/es/about/ Structure Tab Settings Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 11
  • 12. Structure (Third Party Add-on) {if segment_1 ‘es’ OR segment_1 ‘fr’} {!-- START FROM SEGMENT 2 IF NOT DEFAULT LANGUAGE --} {exp:structure:nav_sub start_from=’/{segment_1}/{segment_2}’} {if:else} {!-- START FROM SEGMENT 1 IF DEFAULT LANGUAGE --} {exp:structure:nav_sub start_from=’/{segment_1}’} {/if} Example nav_sub code Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 12
  • 13. LG Multi Language Pro (Third Party Add-on) http://newism.com.au/ Developed by Leevi Graham of Newism Web design & Development. The add-on bundle was commissioned by myself to suit a particular client’s needs and workflow. It will hopefully be released back into the community by Leevi. • Based on member group, hide unnecessary custom fields • Needed a way of showing the status of a translation • A phrase translator with separate plugin Background & Design Brief Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 13
  • 14. LG Multi Language Pro (Third Party Add-on) Extension & Member Settings Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 14
  • 15. LG Multi Language Pro (Third Party Add-on) Custom Fields & Phrase Translator Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 15
  • 16. LG Multi Language Pro (Third Party Add-on) Publish & Edit Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 16
  • 17. LG Multi Language Pro (Third Party Add-on) {exp:lg_mlp:translate key=”phrase_key_1”} {exp:weblog:entries weblog=”{weblog_name}” limit=”1”} <h1>{if lg_lang == “en” || {lg_lang}_title ==’’}{title} {if:else}{{lg_lang}_title}{/if}</h1> {if {lg_lang}_body ==’’} {en_body} {if:else} {{lg_lang}_body} {/if} {/exp:weblog:entries} Code Examples Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 17
  • 18. LG Multi Language Pro (Third Party Add-on) Structure Mashup Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 18
  • 19. Localisation http://code.google.com/apis/maps/documentation/#Localization <script src=”http://maps.google.com/maps?file=api&amp;v=2&amp;key=A BQIAAAAOVcwajvU2DiR3d7wTOAC9RQz9Es_Zr-eU6lD2TDm4seUBz8DBBTcpZXs91l DdbygrzYt7dFVZ_-4Tw&amp;hl={country_code};” type=”text/javascript”></script> Google Maps Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 19
  • 20. Localisation <script type=”text/javascript” src=”/inc/scripts/i18n/ ui.datepicker-{country_code}.js”></script> <script type=”text/javascript”> $(function() { $(“#dob”).datepicker($.datepicker.regional[‘{country_code}’]); }); </script> jQuery UI Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 20
  • 21. ExpressionEngine 2.0 and beyond New publish layout feature is a translation gift in disguise! Member Groups & Fields Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 21
  • 22. ExpressionEngine 2.0 and beyond New publish layout feature is a translation gift in disguise! Publish Layout & Tabs Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 22
  • 23. ExpressionEngine 2.0 and beyond New publish layout feature is a translation gift in disguise! Seperating Fields Multi-Language Websites in ExpressionEngine by John Henry Donovan 2010 - @johnhenry_ie PAGE 23
  • 25. Go raibh maith agaibh