Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro to multi-lingual sites in ExpressionEngine

Intro to multi-lingual sites in ExpressionEngine

Delivered on May 30th 2012 at the European ExpressionEngine conference (EECI) A look at some of the approaches to building multi-lingual sites in ExpressionEngine CMS.

Avatar for Steven Grant

Steven Grant

May 30, 2012
Tweet

More Decks by Steven Grant

Other Decks in Technology

Transcript

  1. •Scottish front-end developer •sometimes designer •I run ghijk (pronounced geek)

    & 1 half of eethem.es with Ryan Downie •#eecms user since late 2007(ish) - using #eecms pretty much exclusively since last year background
  2. first things first •establish the need/requirement of your project •think

    about the UX from YOUR customer’s point of view •will help define your technical approach: •single editor for all languages •multiple editor with 1 language responsibility •3rd party language translators •multiple versions of the site (MSM)
  3. •approach driven from customer needs •always be thinking about your

    user •proper character encoding (UTF-8) for templates as well as for MySQL and MySQL connection from the start (hat tip to Republic Factory) technical
  4. •#eecms needs to know what your language is •config vars

    in index.php or utilise segment vars •pro tip: use iso language codes
  5. •sub folders at the root •index.php sets url for language

    and defines country code •custom field per channel to specify the language for the entry •utilise the search param passing in the country code •http://bit.ly/cwceecms carl crawley
  6. structure •love it/loathe it? •in my experience, clients prefer it

    •breaks the template_group/template #eecms scenario •language branches •use start_from parameter to control nav •use custom title field to generate page title in current language
  7. transcribe •create secondary languages within control panel •creates a related

    entry for master language •tags to switch language •language variables per language to be used for snippets outside of entries - copyright etc. •compatible with structure
  8. my approach •using a combo of •freebie •structure •matrix +

    P&T field pack •switchee •structure entries •low variables
  9. {exp:switchee variable = "{freebie_1}" parse="inward"} {case value="en|nl"} {exp:channel:entries require_entry="yes" {gv_param_disable_default}

    } {if no_results}{redirect="404"}{/if} {cf_page_content search:cmf_language="={freebie_1}"} {cmf_content} {/cf_page_content} {/exp:channel:entries} {/case} {case default="Yes"} {redirect="404"} {/case} {/exp:switchee} switchee
  10. •native structure nav: start_from param for main language •can inject

    segment_1 language indicator using freebie structure entries
  11. localisation •html language codes we can do as <html lang=”en”>

    <html lang=”nl”> <html lang=”es”> <html lang=”{freebie_1}”>
  12. other useful add-ons •ed language switcher (jamie pittock @ erskine

    design) •mx multi language labels (max lazar) •date/time language converter (santa claus wannabe)