Top Banner
39
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: DDAY2014 - Localizing Drupal Commerce
Page 2: DDAY2014 - Localizing Drupal Commerce
Page 3: DDAY2014 - Localizing Drupal Commerce

Localizing Drupal Commercea brief glance to how Drupal Commerce become multilingual

Page 4: DDAY2014 - Localizing Drupal Commerce

ROBERTO PERUZZO

E [email protected] @robertoperuzzo W www.studioaqua.it In it.linkedin.com/in/robertoperuzzo

Software Developer

Page 5: DDAY2014 - Localizing Drupal Commerce

Drupal CommerceIs an Open Source eCommerce framework built from the ground up on Drupal 7.

Page 6: DDAY2014 - Localizing Drupal Commerce

Why Drupal Commerce• Mature project • Good documentation & community • Flexible & Extensible

Page 7: DDAY2014 - Localizing Drupal Commerce

Commerce GuysIs the company born from the Drupal community. It develops and supports the Drupal Commerce project.

Page 8: DDAY2014 - Localizing Drupal Commerce

Need help? Get help!• Guides [http://www.drupalcommerce.org/user-guide] • Videos [http://www.drupalcommerce.org/videos] • Inquiry [https://commerceguys.com/inquiry]

Page 9: DDAY2014 - Localizing Drupal Commerce

Store & Storehouse• How do you store? • How do you sell?

…Drupal Commerce doesn't care.

Page 10: DDAY2014 - Localizing Drupal Commerce

Product• Drupal entity • Define the product features

or product variation

Page 11: DDAY2014 - Localizing Drupal Commerce

Product page• Drupal node • Gathers product variations

or product display

Page 12: DDAY2014 - Localizing Drupal Commerce

Product Page & Product

Page 13: DDAY2014 - Localizing Drupal Commerce

Globalization• Internationalisation (i18n) • Localisation (L10n)

Page 14: DDAY2014 - Localizing Drupal Commerce

A big headache

translation entity_translation i18n_taxonomy

Product Page (node)

Product (entity)

Properties (taxonomy)

Elements

Modules

Page 15: DDAY2014 - Localizing Drupal Commerce

Take an aspirinProduct Page

(entity)Product

(entity)Property

(entity)

Elements

Modules

entity_translation +

title

entity_type = node entity_type = product entity_type = taxonomy_term

Page 16: DDAY2014 - Localizing Drupal Commerce

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

Page 17: DDAY2014 - Localizing Drupal Commerce

Site configurations• Are your regional settings correct? • Add your language • Configure language detection • Import language files • Enable language selector for site visitors

Page 18: DDAY2014 - Localizing Drupal Commerce

Regional settings !

admin/config/regional/settings

Page 19: DDAY2014 - Localizing Drupal Commerce

Your language !

admin/config/regional/language

Page 20: DDAY2014 - Localizing Drupal Commerce

Language prefix

admin/config/regional/language/edit/en

Page 21: DDAY2014 - Localizing Drupal Commerce

Content language detection

admin/config/regional/language/configure

Page 22: DDAY2014 - Localizing Drupal Commerce

Content language detection URL

admin/config/regional/language/configure/url

Page 23: DDAY2014 - Localizing Drupal Commerce

Import language files

admin/config/regional/translate

Drupal core: https://localize.drupal.org/ Drupal Commerce: https://localize.drupal.org/translate/downloads?project=commerce

Page 24: DDAY2014 - Localizing Drupal Commerce

Import language files

admin/config/regional/translate/import

Page 25: DDAY2014 - Localizing Drupal 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

Page 26: DDAY2014 - Localizing Drupal Commerce

Configure translation• Select the translatable entity types • Enable field translation • Multilingual support for taxonomies • Set some sensible defaults

Page 27: DDAY2014 - Localizing Drupal Commerce

Select translatable entities

admin/config/regional/entity_translation

Page 28: DDAY2014 - Localizing Drupal Commerce

Field translation for content types

admin/structure/types/manage/<node-type-machine-name>

Page 29: DDAY2014 - Localizing Drupal Commerce

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

Page 30: DDAY2014 - Localizing Drupal Commerce

Enable multilingual support for taxonomies

admin/structure/taxonomy/<vocabulary-name>/fields

Convert the name and description into a translatable field

and enable the translation

Page 31: DDAY2014 - Localizing Drupal Commerce

Set some sensible defaults

admin/config/regional/entity_translation

Page 32: DDAY2014 - Localizing Drupal Commerce

Translate content• Translate fields • Translate taxonomy items

Page 33: DDAY2014 - Localizing Drupal Commerce

Product creation (italian)

node/add/<content-type-name>

Page 34: DDAY2014 - Localizing Drupal Commerce

Product variation (italian)

node/add/<content-type-name>

Page 35: DDAY2014 - Localizing Drupal Commerce

Product translation (english)

node/<nid>/edit/add/it/en?destination=admin/commerce/products

Page 36: DDAY2014 - Localizing Drupal Commerce

Taxonomy translation (italian)

taxonomy/term/<tid>/edit/it

Page 37: DDAY2014 - Localizing Drupal Commerce

Taxonomy translation (english)

taxonomy/term/<tid>/edit/en

Page 38: DDAY2014 - Localizing Drupal Commerce

Materialehttp://bit.ly/StudioAquaDrupalday2014

E [email protected] T @robertoperuzzo

Q&A

Page 39: DDAY2014 - Localizing Drupal Commerce