openeuropa/oe_multilingual

Name: oe_multilingual

Owner: OpenEuropa

Description: OpenEuropa Multilingual module.

Created: 2018-04-26 16:19:07.0

Updated: 2018-05-25 14:21:06.0

Pushed: 2018-05-25 14:44:26.0

Homepage: null

Size: 83

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

OpenEuropa Multilingual

Build Status

The OpenEuropa Multilingual module offers default multilingual features for the OpenEuropa project, like:

Table of contents:

Installation

The recommended way of installing the OpenEuropa Multilingual module is via a Composer-based workflow.

In your Drupal project's main composer.json add the following dependency:


"require": {
    "openeuropa/oe_multilingual": "dev-master"
}

And run:

mposer update
Enable the module

In order to enable the module in your project run:

vendor/bin/drush en oe_multilingual
Development

The OpenEuropa Multilingual project contains all the necessary code and tools for an effective development process, such as:

Project setup

Download all required PHP code by running:

mposer install

This will build a fully functional Drupal test site in the ./build directory that can be used to develop and showcase the module's functionality.

During development the module requires a fully functional OpenEuropa Theme to be present and enabled on the test site.

In order to achieve that we need to manually install and build all frontend-related theme dependencies as described in the “Project setup” section of the OpenEuropa Theme documentation.

In short:

 build/themes/contrib/oe_theme
m install
m run build

In order to fetch the required code you'll need to have Node.js (>= 8) installed locally.

Before setting up and installing the site make sure to customize default configuration values by copying runner.yml.dist to ./runner.yml and overriding relevant properties.

To set up the project run:

vendor/bin/run drupal:site-setup

This will:

After a successful setup install the site by running:

vendor/bin/run drupal:site-install

This will:

Using Docker Compose

The setup procedure described above can be sensitively simplified by using Docker Compose.

Requirements:

Run:

cker-compose up -d

Then:

cker-compose exec -u web web composer install
cker-compose exec -u node node npm install
cker-compose exec -u node node npm run build
cker-compose exec -u web web ./vendor/bin/run drupal:site-setup
cker-compose exec -u web web ./vendor/bin/run drupal:site-install

Your test site will be available at http://localhost:8080/build.

Run tests as follows:

cker-compose exec -u web web ./vendor/bin/phpunit
cker-compose exec -u web web ./vendor/bin/behat
Disable Drupal 8 caching

Manually disabling Drupal 8 caching is a laborious process that is well described here.

Alternatively you can use the following Drupal Console commands to disable/enable Drupal 8 caching:

vendor/bin/drupal site:mode dev  # Disable all caches.
vendor/bin/drupal site:mode prod # Enable all caches.

Note: to fully disable Twig caching the following additional manual steps are required:

  1. Open ./build/sites/default/services.yml
  2. Set cache: false in twig.config: property. E.g.:
    meters:
    .config:
    e: false
    
  3. Rebuild Drupal cache: ./vendor/bin/drush cr

This is due to the following Drupal Console issue.

Demo module

The OpenEuropa Multilingual module ships with a demo module which provides all the necessary configuration and code needed to showcase the modules's most important features.

The demo module includes a translatable content type with automatic URL path generation.

In order to install the OpenEuropa Multilingual demo module follow the instructions here or enable it via Drush by running:

vendor/bin/drush en oe_multilingual_demo -y

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.