Add Translations update steps.

To facilitiate a translations check site this patch enables the ability
to perform a pull_catalog and compilemessages, which will update the
translations site. By default this won't run at all.

Change-Id: Ib9b527d60226d3133206675b394d83f1185631b2
This commit is contained in:
Andy McCrae 2017-06-08 16:20:29 +01:00 committed by Jesse Pretorius (odyssey4me)
parent 366d05db99
commit 0fa5b59428
4 changed files with 49 additions and 0 deletions

View File

@ -291,6 +291,11 @@ horizon_pip_packages:
# that could be needed for additional dashboards
horizon_optional_pip_packages: []
# This variable is used to update the horizon translations from
# Zanata, this can be set to "True" when testing translations,
# but should otherwise be left as False.
horizon_translations_update: False
# This variable is used by the repo_build process to determine
# which host group to check for members of before building the
# pip packages required by this role. The value is picked up

View File

@ -0,0 +1,8 @@
---
features:
- You can force update the translations direct
from Zanata by setting ``horizon_translations_update``
to ``True``. This will call the ``pull_catalog``
option built into ``horizon-manage.py``. You should
only use this when testing translations, otherwise
this should remain set to the default of ``False``.

View File

@ -0,0 +1,31 @@
---
# Copyright 2017, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Perform a Horizon Zanata Pull Catalog
command: "{{ horizon_bin }}/horizon-manage.py pull_catalog"
args:
chdir: "{{ horizon_lib_dir }}/"
changed_when: false
- name: Perform Horizon Zanata Compile Messages
command: "{{ horizon_bin }}/horizon-manage.py compilemessages"
args:
chdir: "{{ horizon_lib_dir }}/{{ item }}"
with_items:
- horizon
- openstack_dashboard
tags:
- skip_ansible_lint
notify: Restart apache2

View File

@ -100,5 +100,10 @@
tags:
- horizon-config
- include: horizon_translations_update.yml
when: horizon_translations_update | bool
tags:
- horizon-translations-update
- name: Flush handlers
meta: flush_handlers