drupalday - localizing drupal commerce

39

Upload: roberto-peruzzo

Post on 05-Jul-2015

177 views

Category:

Software


1 download

DESCRIPTION

Localizing Drupal Commerce, un breve sguardo a come Drupal Commerce diventa multilingua Nella mia esperienza Drupal Commerce rappresenta uno strumento versatile per realizzare progetti e-commerce, riuscendo ad adattarsi a diversi tipi di business grazie alla sua gestione delle varianti di prodotto. Negli ultimi anni stiamo assistendo ad una continua crescita degli acquisti online e sempre più aziende italiane e non puntano alla domanda estera per accrescere il proprio fatturato. Quindi l’internazionalizzazione dell’e-commerce è diventata un’esigenza.  Drupal Commerce è in grado di realizzare e-commerce multilingua e vari sono modi per poterlo fare. Con questo intervento voglio portare alla luce la prassi da me utilizzata per “internazionalizzare” Drupal Commerce attraverso l’utilizzo e la configurazione di moduli aggiuntivi (es. Entity Translation, Title). I partecipanti avranno quindi una traccia di come localizzare progetti e-commerce realizzati con Drupal e avere un motivo in più per credere che Drupal sia un framework eccellente per lo sviluppo di e-commerce.

TRANSCRIPT

Page 1: DrupalDay - Localizing Drupal Commerce
Page 2: DrupalDay - Localizing Drupal Commerce
Page 3: DrupalDay - Localizing Drupal Commerce

Localizing Drupal Commercea brief glance to how Drupal Commerce become multilingual

Page 4: DrupalDay - Localizing Drupal Commerce

ROBERTO PERUZZO

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

Software Developer

Page 5: DrupalDay - Localizing Drupal Commerce

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

Page 6: DrupalDay - Localizing Drupal Commerce

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

Page 7: DrupalDay - Localizing Drupal Commerce

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

Page 8: DrupalDay - 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: DrupalDay - Localizing Drupal Commerce

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

…Drupal Commerce doesn't care.

Page 10: DrupalDay - Localizing Drupal Commerce

Product• Drupal entity • Define the product features

or product variation

Page 11: DrupalDay - Localizing Drupal Commerce

Product page• Drupal node • Gathers product variations

or product display

Page 12: DrupalDay - Localizing Drupal Commerce

Product Page & Product

Page 13: DrupalDay - Localizing Drupal Commerce

Globalization• Internationalisation (i18n) • Localisation (L10n)

Page 14: DrupalDay - Localizing Drupal Commerce

A big headache

translation entity_translation i18n_taxonomy

Product Page (node)

Product (entity)

Properties (taxonomy)

Elements

Modules

Page 15: DrupalDay - 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: DrupalDay - 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: DrupalDay - 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: DrupalDay - Localizing Drupal Commerce

Regional settings !

admin/config/regional/settings

Page 19: DrupalDay - Localizing Drupal Commerce

Your language !

admin/config/regional/language

Page 20: DrupalDay - Localizing Drupal Commerce

Language prefix

admin/config/regional/language/edit/en

Page 21: DrupalDay - Localizing Drupal Commerce

Content language detection

admin/config/regional/language/configure

Page 22: DrupalDay - Localizing Drupal Commerce

Content language detection URL

admin/config/regional/language/configure/url

Page 23: DrupalDay - 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: DrupalDay - Localizing Drupal Commerce

Import language files

admin/config/regional/translate/import

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

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

Page 27: DrupalDay - Localizing Drupal Commerce

Select translatable entities

admin/config/regional/entity_translation

Page 28: DrupalDay - Localizing Drupal Commerce

Field translation for content types

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

Page 29: DrupalDay - 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: DrupalDay - 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: DrupalDay - Localizing Drupal Commerce

Set some sensible defaults

admin/config/regional/entity_translation

Page 32: DrupalDay - Localizing Drupal Commerce

Translate content• Translate fields • Translate taxonomy items

Page 33: DrupalDay - Localizing Drupal Commerce

Product creation (italian)

node/add/<content-type-name>

Page 34: DrupalDay - Localizing Drupal Commerce

Product variation (italian)

node/add/<content-type-name>

Page 35: DrupalDay - Localizing Drupal Commerce

Product translation (english)

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

Page 36: DrupalDay - Localizing Drupal Commerce

Taxonomy translation (italian)

taxonomy/term/<tid>/edit/it

Page 37: DrupalDay - Localizing Drupal Commerce

Taxonomy translation (english)

taxonomy/term/<tid>/edit/en

Page 38: DrupalDay - Localizing Drupal Commerce

Materialehttp://bit.ly/StudioAquaDrupalday2014

E [email protected] T @robertoperuzzo

Q&A

Page 39: DrupalDay - Localizing Drupal Commerce