
An approach to i18n for Angular HTML templates using babel. This patch allows only singular translation. Plurals and context will be addressed in subsequent patches. Based on Thai Tran's work at https://review.openstack.org/#/c/187321 This patch implements a custom extractor in horizon/utils/babel_extract_angular.py. pybabel really wants this to be a package installed into site-packages. I have not done this so as to avoid introducing a dependency on another change to global requirements just yet. I will upload a package to pypi in parallel so that we can start using it in the future. For now, I have had to modify tools/with_venv.sh to add horizon to the PYTHONPATH. This is less than ideal but seemed to be the least worst option. Steps to verify that it works: 1. Create a new html file in horizon/static or openstack_dashboard/static 2. Add something like <div translate>hello world!</div> to the html To test interpolation add something like: <div translate>hello {$name$}!</div> 3. Run ./run_tests.sh --makemessages 4. Inspect your djangojs.po file, it should be there. The following steps are optional: 5. Run ./run_tests.sh --pseudo de 6. Run ./run_tests.sh --compilemessages 7. Go to http://localhost:8000/settings 8. Change Language to Deutsch 9. Go to http://localhost:8000/i18n/js/horizon+openstack_dashboard 10. Your translated text should be there as well. Note: There are now unit tests as well. Partially-Implements: blueprint angular-translate-makemessages Depends on: If4352aba01ce0ca6337f590c0689d8fe9f0867c8 Change-Id: I26d4fef8646d5f038918cd3376dbbdbef37eb603
Horizon (OpenStack Dashboard)
Horizon is a Django-based project aimed at providing a complete
OpenStack Dashboard along with an extensible framework for building new
dashboards from reusable components. The
openstack_dashboard
module is a reference implementation of
a Django site that uses the horizon
app to provide
web-based interactions with the various OpenStack projects.
- Release management: https://launchpad.net/horizon
- Blueprints and feature specifications: https://blueprints.launchpad.net/horizon
- Issue tracking: https://bugs.launchpad.net/horizon
Using Horizon
See doc/source/topics/install.rst
about how to install
Horizon in your OpenStack setup. It describes the example steps and has
pointers for more detailed settings and configurations.
It is also available at http://docs.openstack.org/developer/horizon/topics/install.html.
Getting Started for Developers
doc/source/quickstart.rst
or http://docs.openstack.org/developer/horizon/quickstart.html
describes how to setup Horizon development environment and start
development.
Building Contributor Documentation
This documentation is written by contributors, for contributors.
The source is maintained in the doc/source
directory
using reStructuredText and
built by Sphinx
Building Automatically:
$ ./run_tests.sh --docs
Building Manually:
$ tools/with_venv.sh sphinx-build doc/source doc/build/html
Results are in the doc/build/html
directory