Download - DDAY2014 - Localizing Drupal Commerce
ROBERTO PERUZZO
E [email protected] @robertoperuzzo W www.studioaqua.it In it.linkedin.com/in/robertoperuzzo
Software Developer
Commerce GuysIs the company born from the Drupal community. It develops and supports the Drupal Commerce project.
Need help? Get help!• Guides [http://www.drupalcommerce.org/user-guide] • Videos [http://www.drupalcommerce.org/videos] • Inquiry [https://commerceguys.com/inquiry]
A big headache
translation entity_translation i18n_taxonomy
Product Page (node)
Product (entity)
Properties (taxonomy)
Elements
Modules
Take an aspirinProduct Page
(entity)Product
(entity)Property
(entity)
Elements
Modules
entity_translation +
title
entity_type = node entity_type = product entity_type = taxonomy_term
Modules for translation$drush dl entity_translation
$drush en entity_translation -y $drush dl title
$drush en title -y $drush dl variable
$drush en variable -y $drush dl i18n
$drush en i18n, i18n_translation, i18n_field, i18n_menu -y
Site configurations• Are your regional settings correct? • Add your language • Configure language detection • Import language files • Enable language selector for site visitors
Import language files
admin/config/regional/translate
Drupal core: https://localize.drupal.org/ Drupal Commerce: https://localize.drupal.org/translate/downloads?project=commerce
Enable language selector block
admin/structure/block
<?php!
! $block = module_invoke('locale', 'block_view', 'language');!
! print render($block['content']);!
?>
or through the code
Into block setting page
Configure translation• Select the translatable entity types • Enable field translation • Multilingual support for taxonomies • Set some sensible defaults
Replace title and enable fields translation
admin/structure/types/manage/<content-type-machine-name>/fileds
Convert the title into a translatable field
and edit each field you want to translate
Enable multilingual support for taxonomies
admin/structure/taxonomy/<vocabulary-name>/fields
Convert the name and description into a translatable field
and enable the translation