Commit 669cfc07 authored by Victor Nikulshin's avatar Victor Nikulshin

Merge branch 'feature/no-languages-install' into '2.x'

Regularize usage of locale and site_languages config

On n'a pas de besoin d'avoir deux parameters qui configure la locale d'installation. Seulement site_languages is suffisant.

See merge request !23
parents d4aa5137 1e1c056f
Pipeline #1333 failed with stages
in 9 seconds
......@@ -35,9 +35,6 @@ Those are global project parameters mandatory to Drupalizer.
|This env var is defined by Fabric itself, and it's defaut value is True.
|You can easily pass it to False, addinf --no-pty to your fab command line. Useful in Jenkins jobs.
|_locale_
|If True, install the site in French.
|===
=== Site settings
......@@ -88,7 +85,7 @@ Those are global project parameters mandatory to Drupalizer.
|The Drupal site directory (only for multisite). Default: _default_.
|_site_languages_
|Translation files you need to download when building new Drupal installation (separate with comma). Default: _fr_.
|Translation files that must be downloaded when building Drupal and activated during installation (separate with comma). Default: _fr_.
|===
......
......@@ -7,7 +7,6 @@ from fabric.api import env
env.project_name = 'drupalizer-default'
env.workspace = path.join(path.dirname(__file__), path.pardir)
env.locale = False
# Site
......
......@@ -49,12 +49,13 @@ def make(action='install'):
drush_opts += "--contrib-destination=profiles/{} ".format(env.site_profile)
h.update_profile()
if not env.get('always_use_pty', True):
drush_opts += "--translations=" + env.site_languages + " "
elif confirm(red('Say [Y] to {} the site at {} with the specified translation(s): {}. If you say [n] '
'the site will be installed in English only'.format(action, env.site_root, env.site_languages))):
if env.site_languages:
if not env.get('always_use_pty', True):
drush_opts += "--translations=" + env.site_languages + " "
elif confirm(red('Say [Y] to {} the site at {} with the specified translation(s): {}. If you say [n] '
'the site will be installed in English only'.format(action, env.site_root, env.site_languages))):
drush_opts += "--translations=" + env.site_languages + " "
drush_opts += "--translations=" + env.site_languages + " "
if env.get('always_use_pty', True):
drush_opts += " --working-copy --no-gitinfofile"
......@@ -127,7 +128,10 @@ def site_install():
h.fab_run(role, 'chown {}:{} ./sites'.format(env.apache_user, env.apache_user))
h.fab_run(role, 'chmod ug+w ./sites/default'.format(env.docker_site_root))
locale = '--locale="fr"' if env.locale else ''
if env.site_languages:
locale = '--locale="{}"'.format(env.site_languages.split(',')[0])
else:
locale = ''
h.fab_run(role, 'sudo -u {} drush site-install {} {} --db-url=mysql://{}:{}@{}/{} --site-name="{}" '
'--account-name={} --account-pass={} --sites-subdir={} -y'.format(apache, profile, locale,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment