52
DRUPAL8 MULTILINGUAL AWESOMENESS & WHAT'S NEW / Chakrapani R @chakri_iiith Azri Solutions

DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

DRUPAL8MULTILINGUAL AWESOMENESS & WHAT'S NEW

/ Chakrapani R @chakri_iiith

Azri Solutions

Page 2: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

CHAKRAPANI R(CHAKRI)From Bangalore, IndiaDrupal architect at Azri SolutionsDrupal since 2009Lead Organizer of Drupal Bangalore

Page 3: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

OVERVIEWLanguage first installerCore multilingual modulesOptional and translatable EnglishLanguage detection optionsLanguage visibility and filteringTransliterationImproved translation UIContent and Configuration translations

Page 4: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

LANGUAGE FIRST INSTALLERBrowser based language detectionAutomated translation downloaderRemove english if chosen language is foreignComplete rtl support

Page 5: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

LANGUAGE FIRST INSTALLER

Page 6: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

TRANSLATION DOWNLOADER

Page 7: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

REMOVE ENGLISH

Page 8: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

COMPLETE RTL SUPPORT

Page 9: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

MORE CORE MODULES4 core modules ~ 20+ D7 modules

Page 10: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

Image source: http://hojtsy.hu/multilingual-drupal8

Page 11: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

SIMPLE LANGUAGE SETUP AND OPTIONALENGLISH

Simple language overview screenAdd/Remove languages including englishNo more disabled languages

Page 12: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native
Page 13: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native
Page 14: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

HIGLY FLEXIBLE DETECTION OPTIONS

Page 15: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

LANGUAGE DETECTION OPTIONS FORCONTENT

Page 16: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native
Page 17: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native
Page 18: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native
Page 19: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

LIMITLESS LANGUAGE ASSIGNMENTEXTENSIBLE SPECIAL LANGUAGES

Not everything can have a languageLanguage neutral in D7 was a special languageIn D8, we have two special languages 'Not Applicable' and 'NotspecifiedModules can add languages like these

Page 20: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

YOU CAN CREATE VIEWS IN ANY LANGUAGE

Page 21: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

CONTENT ENTITIES WITH BUNDLES ARE MORE FLEXIBLEIn D7, we have content type settings for language featureD8 explands it to all entity types and bundlesD8 entities include Comments, users, taxonomy terms, nodes,menus and custom blocksCentral configuration screen for all these entity types

Page 22: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native
Page 23: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native
Page 24: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

EASIER RTL STYLINGLanguage setings include rtl or ltr orientation per languageClean support for rtl from picking the install profileIn D7, for any css file, the rtl counterpart was file-rtl.cssNow rtl is all integrated in actual cssyou should use attribute selectors like [dir="rtl"]

Page 25: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native
Page 26: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

LANGUAGE VISIBILITY AND FILTERINGBlock visibility

Extended visibility setting for languageeg: seperate menus for differenct languages displayed throughblocksDrupal allows you to configure a separate languagenegotiation method for content

Page 27: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native
Page 28: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

LANGUAGE VISIBILITY AND FILTERINGViews language filtering

Page 29: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

TRANSLITERATION IN COREDrupal now comes with powerfull transliteration systemUsed for machine name generation

Page 30: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

TRANSLITERATION IN CORE

Page 31: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

DEPLOYMENT FRIENDLY AUTOMATEDDOWNLOADS

Automated translation downloadsAutomated updates from the communityUpdate frequency, source and overrides are configurable

Page 32: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

STAGING AND DEPLOYMENT FRIENDLYAll the retrieved files are stored in once central directoryDev environment can enable translation updatesLive environment to have it disabledImport in live can be done from a preconfigured directoryThis dir can be put under version control

Page 33: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native
Page 34: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

CONTEXT SPECIFIC TRANSLATION APIS

Page 35: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

NO MORE GET_T() AND ST()In D7, t() can be used only after db was setupst() should be used during installationOtherwise, use get_t() to get the right callbackIn drupal8, this is handled within t()

Page 36: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

Context in Drupal.t() and Drupal.formatPlural()

In D7, t() and format_plural could take contextWhich helps the translators to translate ambiguous textThis is now extented to their JS counterparts

Drupal.t('May', {}, {context: "Long month name"});

Page 37: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

Translation in Twig templates

This is not a phptemplate so we can't use t() directlyThis is possible with 't' or 'trans'{% trans %} block is also supported

{{ 'Hello Delhi.'|trans }}{{ 'Hello Delhi.'|t }}

{% set count = 1 %}{% trans %} One Commit.{% plural count %} {{ count }} Commits.{% endtrans %}

Page 38: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

STRING CUSTOMIZATIONS TRACKED

Page 39: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

STRING CUSTOMIZATIONS TRACKED

Page 40: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

TRANSLATABLE ENGLISH

Page 41: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

TRANSLATABLE ENGLISH

Page 42: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

IMPROVED TRANSLATION UI

Page 43: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

IMPROVED TRANSLATION UI

Page 44: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

CONTENT AND CONFIGURATIONTRANSLATIONS

D7 provides translation capabilities for nodes but no othercontent or configurationWant to translate Blocks, Terms or menus ? NoComplicated solutions by contributed modulesi18n_menu, i18n_block, i18n_variable, i18nviews,webform_localization

Page 45: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

DRUPAL 8 HAS GENERAL BASE SOLUTION INCORE

Mostly we work with either Configuration or a Content(entities)Content entities almost all have fieldsFields come with native support for multilingual storage,editing and renderingEvery piece of content is now translatableNo need for specialized systems and glue modules!

Page 46: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

CONFIGURATION TRANSLATIONSConfig system has full support for language overridesAll values stored in configuration may have a languagevarianceContexual access system lets you load values with specificlanguage overridesThese overrides are fully deployment friendlyDefault(shipped) configuration is translatableEg: shipped Views, content types, fields, etcConfig translation provides the UI

Page 47: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native
Page 48: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

CONFIG VS CONTENT

Image source: http://hojtsy.hu/multilingual-drupal8

Page 49: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

CONFIGURATION TRANSLATIONS - HOWhow do we know the language of your configDrupal 8 configuration system uses YAML files to storesettings

Copied and modified. Source is not modified

system.site.ymluuid: ''name: Drupalmail: ''slogan: ''page: 403: '' 404: '' front: useradmin_compact_mode: falseweight_select_max: 100langcode: en

Page 50: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

No Copies of files for each language

Page 51: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

REFERENCESSlides: http://bit.ly/d8-multilingualMultilingual Drupal by Gabor Hojtsy (http://hojtsy.hu)http://drupal8multilingual.org

Page 52: DRUPAL8 · DRUPAL 8 HAS GENERAL BASE SOLUTION IN CORE Mostly we work with either Configuration or a Content (entities) Content entities almost all have fields Fields come with native

THANK YOU!CHAKRAPANI R / @CHAKRI_IIITH