Creating a Multilingual Install Profile for Drupal
-
Upload
suzanne-dergacheva -
Category
Technology
-
view
307 -
download
0
Transcript of Creating a Multilingual Install Profile for Drupal
![Page 1: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/1.jpg)
CREATING A MULTILINGUAL INSTALL PROFILE
![Page 2: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/2.jpg)
Drupal Consulting, Development, and Training evolvingweb.ca
Suzanne Dergacheva, Co-founder @suzanne_kennedy
![Page 3: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/3.jpg)
TRAINING PROGRAMevolvingweb.ca/training
!
![Page 4: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/4.jpg)
MAKING A MULTILINGUAL WEBSITE - CHECKLIST
![Page 5: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/5.jpg)
MULTILINGUAL CHECKLIST• Enable some modules
• Add languages
• Set up language negotiation
• Pull in languages from localize.drupal.org
• Turn on the language switcher
![Page 6: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/6.jpg)
MULTILINGUAL CHECKLIST• Enable field-level translation for content types
• Add variable translations
• Enable translation for the main menu
• Set the language of menu items
• Setup pathauto patterns for each language
![Page 7: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/7.jpg)
Configuration > Regional & language > Languages
Installing Languages
![Page 8: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/8.jpg)
Language Detection & Selection
Using the URL as the primary method of language detection
![Page 9: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/9.jpg)
Localization Update
drupal.org/project/l10n_update
![Page 10: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/10.jpg)
Switching Languages
![Page 11: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/11.jpg)
Setting up Field Translation
![Page 12: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/12.jpg)
Translating Variables
![Page 13: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/13.jpg)
Translating Menus
![Page 14: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/14.jpg)
Pathauto PatternsCreate a pathauto pattern per language
![Page 15: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/15.jpg)
HOW TO SCRIPT THIS?
• Create a post-install script - using drush commands and php scripts
• Create an install profile
• Create an install profile, with make files
![Page 16: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/16.jpg)
WHAT’S IN THE SCRIPT?drush en admin_menu admin_menu_toolbar locale l10n_update entity_translation -y
drush variable-realm-set language en site_name "Multilingual Drupal”
drush scr create-menu-items.script
drush vset language_content_type_article 4
drush l10n-update
![Page 17: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/17.jpg)
INSTALL PROFILE
![Page 18: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/18.jpg)
RUNNING THE INSTALL PROFILE
![Page 19: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/19.jpg)
RUNNING THE INSTALL PROFILE
![Page 20: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/20.jpg)
DEMO!
![Page 21: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/21.jpg)
.INFO FILEname = Multilingual Startkerkit
description = Profile for setting up a multilingual website.
core = 7.x
version = 0.1
!
;Core Dependencies
dependencies[] = block
dependencies[] = color
dependencies[] = comment
![Page 22: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/22.jpg)
.INSTALL FILE• hook_install
• add text formats
• enable blocks
• add node types
• set variables
• create fields and field instances
![Page 23: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/23.jpg)
.PROFILE FILE• hook_install_tasks
• array of steps for the installer
• each step corresponds to a callback function (could be a form)
• hook_install_tasks_alter
• you can unset steps in the default process
![Page 24: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/24.jpg)
INSTALLATION STEPS
• Select languages
• Import Translations
• Add Sample Content
• Setup Site Info
![Page 25: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/25.jpg)
ADDING .MAKE FILES
![Page 26: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/26.jpg)
.MAKEapi = 2
core = 7.x
; Include the definition for how to build Drupal core directly
includes[] = drupal-org-core.make
!
;Multilingual Starterkit Install Profile
projects[multilingual_starterkit][download][type] = "git"
projects[multilingual_starterkit][download][url] = "https://github.com/pixelite/drupal-multilingual-starterkit"
projects[multilingual_starterkit][download][branch] = "master"
projects[multilingual_starterkit][type] = "profile"
![Page 27: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/27.jpg)
DRUPAL-ORG-CORE.MAKEcore = 7.x
api = 2
!projects[drupal][version] = "7.31"
!projects[views_bulk_operations][version] = "3.2"
projects[views_bulk_operations][subdir] = "contrib"
!projects[admin_menu][version] = "3.0-rc4"
projects[admin_menu][subdir] = "contrib"
!projects[admin_views][version] = "1.3"
![Page 28: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/28.jpg)
USING THE MAKE FILESDownload the make files:
curl https://raw.githubusercontent.com/pixelite/drupal-multilingual-starterkit/master/build-mulitilingual-starterkit.make -o build-multilingual-starterkit.make
curl https://raw.githubusercontent.com/pixelite/drupal-multilingual-starterkit/master/drupal-org-core.make -o drupal-org-core.make
Run the make files using Drush:
drush make build-multilingual-starterkit.make
![Page 29: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/29.jpg)
Drupal Consulting, Development, and Training evolvingweb.ca
Suzanne Dergacheva, Co-founder @suzanne_kennedy
![Page 30: Creating a Multilingual Install Profile for Drupal](https://reader033.fdocuments.in/reader033/viewer/2022052602/55a23db31a28ab196e8b4620/html5/thumbnails/30.jpg)
TRAINING PROGRAMevolvingweb.ca/training
!