2. What we'll cover
Context - sites we've worked on at Cogapp over the last few years
Why multilingual websites?
Drupal 7 - multilingual out of the box
Content translation vs. Entity translation
Useful modules
Right-to-Left scripts
Drupal 8
14. Non-English speaking web users
~75% web content was English in 1998
Now roughly 30%
Arabic web users:
Fastest increase in top 10 languages of the net
2000: 2,560,337 users
2013: 135,610,819 users
> 10x faster than increase in English speakers online
http://www.internetworldstats.com/stats7.htm
15. Language extinction
Only 5% of the world's languages represented online
Unesco: up to half of the world's languages extinct by the end of the century
Diverse web prevents cultural and economic hegemony and inequality
Vannini L., Le Crosnier H. Net.Lang: Towards The Multilingual Cyberspace. C&F Éditions: Caen, France.
2012
17. Locale module (core)
Add languages to your site
Translate the Drupal interface
Language detection and selection
URL format (fr.example.com or example.com/fr)
22. Content translation
Core module in Drupal 6 and 7; not in Drupal 8
Provides ability for you to translate nodes
Each translation of a node is a node in itself
Pro: easier for language site to differ
Con: only nodes are translatable
24. Entity translation
Contrib module in Drupal 7 (beta); core in Drupal 8
Provides ability for you to translate fieldable entities
Define which fields can be translated
Pro: far more can be translated
Pro: core support in D8
Con: D7 core search and revisions not supported
Con: D7 all translations must be provided before any can be pubished
Con: D7 properties can't be translated
global $language; // Site language
global $language_content; // Content language
$entity->field_body['fr'][0]['value'];
$entity->field_body[$language->language][0]['value'];
$entity->field_body[$language_content->language][0]['value'];
$emw->field_body->value(); // Uses $language (site language)
31. Internationalization modules (i18n,
i18n_*)
Extends multilingual support in Drupal 6 + 7
Taxonomy translation
Multilingual blocks
Multilingual variables
Some overlaps with Entity Translation module, but the 2 work together
34. Gotchas
Content editing when site language != content language (e.g. entity
references)
Menu translation - various methods, none perfect
Fonts (particurly webfonts) - do they have all of the characters you need?
Including bold? Including light? .ttf? .svg? .eot?
38. Arabic
Basic alphabet = 28 characters
Eastern Arabic numbers - Left-to-Right!
Caseless
Italics = :(
Some punctuation marks are different
Comma = ،٬
Question mark = ؟
Mostly uses the same punctuation marks used in English
39. RTL on the web
HTML 'dir' attribute
<html dir="rtl"></html>
<p dir="ltr"></p>
CSS 'direction' property
CSS 'unicode-bidi' property
div {
direction:rtl;
unicode-bidi: bidi-override;
}
Unicode left-to-right mark - HTML ‎
Unicode right-to-left mark - HTML ‏
These go before a character to specify where it should be placed in
relation to the previous character
42. Drupal 8
Content translation is obsolete
Entity translation out of the box
Much wider support for translation across the different Drupal elements
4 core modules
http://www.drupal8multilingual.org/