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

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
Loading
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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_.

|===

+0 −1
Original line number Diff line number Diff line
@@ -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
+10 −6
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ def make(action='install'):
        drush_opts += "--contrib-destination=profiles/{} ".format(env.site_profile)
        h.update_profile()

    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] '
@@ -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,