Adding Angular-gettext to requirements
The makemessages side of translation is now angular compatible via babel. Now we need the directives and filters that angular-gettext provides. This patch also configures angular-gettext to use the django catalog. Partially-Implements: blueprint angular-translate-makemessages Change-Id: Ib180953d7bd77170092293247543398d964e7305 Depends-On: Ica8d73752093f2e5d30f70fc37ba87610f6823b1
This commit is contained in:
parent
ede7402604
commit
df355d9553
@ -73,6 +73,7 @@ module.exports = function (config) {
|
||||
xstaticPath + 'angular/data/angular-mocks.js',
|
||||
xstaticPath + 'angular/data/angular-cookies.js',
|
||||
xstaticPath + 'angular_bootstrap/data/angular-bootstrap.js',
|
||||
xstaticPath + 'angular_gettext/data/angular-gettext.js',
|
||||
xstaticPath + 'angular/data/angular-sanitize.js',
|
||||
xstaticPath + 'd3/data/d3.js',
|
||||
xstaticPath + 'rickshaw/data/rickshaw.js',
|
||||
|
@ -16,6 +16,7 @@
|
||||
<script src="{{ STATIC_URL }}horizon/lib/angular/angular-mocks.js"></script>
|
||||
<script src="{{ STATIC_URL }}horizon/lib/angular/angular-cookies.js"></script>
|
||||
<script src="{{ STATIC_URL }}horizon/lib/angular/angular-bootstrap.js"></script>
|
||||
<script src="{{ STATIC_URL }}horizon/lib/angular/angular-gettext.js"></script>
|
||||
<script src="{{ STATIC_URL }}horizon/lib/angular/angular-sanitize.js"></script>
|
||||
<script src="{{ STATIC_URL }}horizon/lib/angular/smart-table.js"></script>
|
||||
<script src="{{ STATIC_URL }}horizon/lib/angular/lrdragndrop.js"></script>
|
||||
|
@ -73,6 +73,7 @@ module.exports = function (config) {
|
||||
xstaticPath + 'angular/data/angular-mocks.js',
|
||||
xstaticPath + 'angular/data/angular-cookies.js',
|
||||
xstaticPath + 'angular_bootstrap/data/angular-bootstrap.js',
|
||||
xstaticPath + 'angular_gettext/data/angular-gettext.js',
|
||||
xstaticPath + 'angular/data/angular-sanitize.js',
|
||||
xstaticPath + 'd3/data/d3.js',
|
||||
xstaticPath + 'rickshaw/data/rickshaw.js',
|
||||
|
@ -22,6 +22,7 @@
|
||||
* angular's extensions.
|
||||
*/
|
||||
var libraryModules = [
|
||||
'gettext',
|
||||
'ngCookies'
|
||||
];
|
||||
|
||||
@ -69,6 +70,7 @@
|
||||
.run(updateHorizon);
|
||||
|
||||
updateHorizon.$inject = [
|
||||
'gettextCatalog',
|
||||
'horizon.framework.conf.spinner_options',
|
||||
'horizon.app.conf',
|
||||
'horizon.framework.util.tech-debt.helper-functions',
|
||||
@ -77,7 +79,15 @@
|
||||
'$cookies'
|
||||
];
|
||||
|
||||
function updateHorizon(spinnerOptions, hzConfig, hzUtils, $cookieStore, $http, $cookies) {
|
||||
function updateHorizon(
|
||||
gettextCatalog,
|
||||
spinnerOptions,
|
||||
hzConfig,
|
||||
hzUtils,
|
||||
$cookieStore,
|
||||
$http,
|
||||
$cookies) {
|
||||
|
||||
$http.defaults.headers.post['X-CSRFToken'] = $cookies.csrftoken;
|
||||
|
||||
//expose the configuration for horizon legacy variable
|
||||
@ -92,6 +102,10 @@
|
||||
getRaw: getRaw
|
||||
});
|
||||
|
||||
// rewire the angular-gettext catalog to use django catalog
|
||||
gettextCatalog.setCurrentLanguage(horizon.languageCode);
|
||||
gettextCatalog.setStrings(horizon.languageCode, django.catalog);
|
||||
|
||||
/*
|
||||
* cookies are updated at the end of current $eval, so for the horizon
|
||||
* namespace we need to wrap it in a $apply function.
|
||||
|
@ -20,6 +20,7 @@ to match their distribution's standards.
|
||||
import xstatic.main
|
||||
import xstatic.pkg.angular
|
||||
import xstatic.pkg.angular_bootstrap
|
||||
import xstatic.pkg.angular_gettext
|
||||
import xstatic.pkg.angular_lrdragndrop
|
||||
import xstatic.pkg.angular_smart_table
|
||||
import xstatic.pkg.bootstrap_datepicker
|
||||
@ -49,6 +50,9 @@ def get_staticfiles_dirs(webroot='/'):
|
||||
('horizon/lib/angular',
|
||||
xstatic.main.XStatic(xstatic.pkg.angular_bootstrap,
|
||||
root_url=webroot).base_dir),
|
||||
('horizon/lib/angular',
|
||||
xstatic.main.XStatic(xstatic.pkg.angular_gettext,
|
||||
root_url=webroot).base_dir),
|
||||
('horizon/lib/angular',
|
||||
xstatic.main.XStatic(xstatic.pkg.angular_lrdragndrop,
|
||||
root_url=webroot).base_dir),
|
||||
|
@ -10,6 +10,7 @@
|
||||
{% compress js %}
|
||||
<script type="text/javascript">var STATIC_URL = "{{ STATIC_URL }}";</script>
|
||||
<script src='{{ STATIC_URL }}horizon/lib/angular/angular-cookies.js'></script>
|
||||
<script src='{{ STATIC_URL }}horizon/lib/angular/angular-gettext.js'></script>
|
||||
<script src='{{ STATIC_URL }}horizon/lib/angular/angular-sanitize.js'></script>
|
||||
<script src="{{ STATIC_URL }}horizon/lib/angular/lrdragndrop.js"></script>
|
||||
<script src="{{ STATIC_URL }}horizon/lib/angular/smart-table.js"></script>
|
||||
|
@ -44,6 +44,7 @@ six>=1.9.0
|
||||
XStatic>=1.0.0 # MIT License
|
||||
XStatic-Angular>=1.3.7 # MIT License
|
||||
XStatic-Angular-Bootstrap>=0.11.0.2 # MIT License
|
||||
XStatic-Angular-Gettext>=2.1.0.2 # MIT License
|
||||
XStatic-Angular-lrdragndrop>=1.0.2.2 # MIT License
|
||||
XStatic-Bootstrap-Datepicker>=1.3.1.0 # Apache 2.0 License
|
||||
XStatic-Bootstrap-SCSS>=3 # Apache 2.0 License
|
||||
|
Loading…
x
Reference in New Issue
Block a user