Angular code should not reference global gettext
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Dashboard (Horizon) |
In Progress
|
Low
|
Unassigned |
Bug Description
Currently Django provides a window-global function gettext() (among others) that is used for presenting translated text. This mechanism is still needed, but it currently is not presented as a service (/factory). This means that the Angular code expects gettext() to be on the global scope, which is not only a bad practice but interferes with testing (having to supply a global-scope mechanism).
The solution is to create a service (through a factory probably) that provides a function through injection.
The rollout of this may be done in phases:
- Create factory and example
- Continue to expand use throughout existing code base
- In some contexts, may actually delete the gettext reference from the global scope
Changed in horizon: | |
assignee: | Matt Borland (palecrow) → Tyr Johanson (tyr-6) |
Changed in horizon: | |
importance: | Undecided → Low |
milestone: | none → next |
tags: | added: angularjs |
Changed in horizon: | |
assignee: | Tyr Johanson (tyr-6) → nobody |
Fix proposed to branch: master /review. openstack. org/175976
Review: https:/