Commit Graph

8 Commits

Author SHA1 Message Date
Neill Cox
9b36822fe2 Angular translation via babel (singular only)
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
2015-07-02 11:13:45 +10:00
Akihiro MOTOKI
7a0581bb70 Import install_venv from oslo
The new version of install_venv_common evaluates requirements.txt
and test-requirements.txt at the same time and we avoid Django 1.6
is installed when evaluating django-nose dependencies.

Change-Id: I2ab7108b3615ac6c0525089b81b80e5c0a4793fc
Closes-Bug: #1250581
2013-11-13 03:34:42 +09:00
Zhenguo Niu
f7a03abc1f Enclose command args in with_venv.sh
It will support argument with blanks.

Change-Id: I4e40cdd2be67c2f306ce53f297b7a830730d1bc7
Fixes: bug #1220937
2013-09-09 14:21:41 +08:00
Monty Taylor
25cefd3f27 Rename venvs to match everyone else.
Change-Id: I22a3ecdc9ddf1ddd557b831e897684a56b2975f6
2012-02-13 12:11:08 -08:00
Gabriel Hurley
a17570110f Unified horizon and openstack-dashboard environments.
Buildout has been removed entirely, all dev installation is now
done via the single tools/install_venv.py script.

Django's manage.py script has also been updated to a newer
version/convention; this allows for less python path mangling
and makes things cleaner and more explicit. Note that, as such,
it has been moved up a directory level.

Change-Id: I62f9f06ee00568fc91e5ba7e1fd15d22ea849d1f
2012-01-05 13:57:07 -08:00
Devin Carlen
d4a5bc97f3 Added django-nova to openstack-dashboard repo 2011-03-02 17:20:17 -08:00
Devin Carlen
303644819e Made with_venv.sh executable 2011-01-12 13:48:45 -08:00
Devin Carlen
d3965a9f0a Initial commit 2011-01-12 13:43:31 -08:00