Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
DRUPAL8MULTILINGUAL AWESOMENESS & WHAT'S NEW
/ Chakrapani R @chakri_iiith
Azri Solutions
CHAKRAPANI R(CHAKRI)From Bangalore, IndiaDrupal architect at Azri SolutionsDrupal since 2009Lead Organizer of Drupal Bangalore
OVERVIEWLanguage first installerCore multilingual modulesOptional and translatable EnglishLanguage detection optionsLanguage visibility and filteringTransliterationImproved translation UIContent and Configuration translations
LANGUAGE FIRST INSTALLERBrowser based language detectionAutomated translation downloaderRemove english if chosen language is foreignComplete rtl support
LANGUAGE FIRST INSTALLER
TRANSLATION DOWNLOADER
REMOVE ENGLISH
COMPLETE RTL SUPPORT
MORE CORE MODULES4 core modules ~ 20+ D7 modules
Image source: http://hojtsy.hu/multilingual-drupal8
SIMPLE LANGUAGE SETUP AND OPTIONALENGLISH
Simple language overview screenAdd/Remove languages including englishNo more disabled languages
HIGLY FLEXIBLE DETECTION OPTIONS
LANGUAGE DETECTION OPTIONS FORCONTENT
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
YOU CAN CREATE VIEWS IN ANY LANGUAGE
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
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"]
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
LANGUAGE VISIBILITY AND FILTERINGViews language filtering
TRANSLITERATION IN COREDrupal now comes with powerfull transliteration systemUsed for machine name generation
TRANSLITERATION IN CORE
DEPLOYMENT FRIENDLY AUTOMATEDDOWNLOADS
Automated translation downloadsAutomated updates from the communityUpdate frequency, source and overrides are configurable
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
CONTEXT SPECIFIC TRANSLATION APIS
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()
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"});
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 %}
STRING CUSTOMIZATIONS TRACKED
STRING CUSTOMIZATIONS TRACKED
TRANSLATABLE ENGLISH
TRANSLATABLE ENGLISH
IMPROVED TRANSLATION UI
IMPROVED TRANSLATION UI
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
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!
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
CONFIG VS CONTENT
Image source: http://hojtsy.hu/multilingual-drupal8
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
No Copies of files for each language
REFERENCESSlides: http://bit.ly/d8-multilingualMultilingual Drupal by Gabor Hojtsy (http://hojtsy.hu)http://drupal8multilingual.org
THANK YOU!CHAKRAPANI R / @CHAKRI_IIITH