← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1446739] [NEW] Angular code should not reference global gettext

 

Public bug reported:

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

** Affects: horizon
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1446739

Title:
  Angular code should not reference global gettext

Status in OpenStack Dashboard (Horizon):
  New

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1446739/+subscriptions


Follow ups

References