diff --git a/defaults/main.yml b/defaults/main.yml index 8bfae615..db1132c2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/releasenotes/notes/update_translations-f950283d821bba05.yaml b/releasenotes/notes/update_translations-f950283d821bba05.yaml new file mode 100644 index 00000000..284e6ecc --- /dev/null +++ b/releasenotes/notes/update_translations-f950283d821bba05.yaml @@ -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``. diff --git a/tasks/horizon_translations_update.yml b/tasks/horizon_translations_update.yml new file mode 100644 index 00000000..0af424b2 --- /dev/null +++ b/tasks/horizon_translations_update.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index fb0a567c..89f908e8 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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