Closed
Bug 1102193
Opened 10 years ago
Closed 10 years ago
Re-implement MozLoopService localization code
Categories
(Hello (Loop) :: Client, defect, P2)
Hello (Loop)
Client
Tracking
(firefox35 fixed, firefox36 fixed)
backlog | Fx36+ |
People
(Reporter: mikedeboer, Assigned: mikedeboer, Mentored)
References
Details
(Whiteboard: [tech-debt])
Attachments
(1 file)
6.91 KB,
patch
|
NiKo
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
- The localizedStrings property of MozLoopServiceInternal is implemented around the outdated assumption that the locale keys may contains dots ('.') to discern various types of strings, thus populates the cache with objects unnecessarily.
- The getStrings() method of MozLoopService therefore returns objects, instead of strings which its name tends to suggest, and even serializes them to JSON.
This is all needlessly complicated; there are no locale key names with dots in loop.properties, so we can just cache a map of strings. If we were to introduce a key with dots, the current implementation would yield confusing results.
Flags: qe-verify-
Flags: firefox-backlog+
Comment 1•10 years ago
|
||
The reason we do it this way is to be compatible with content/libs/l10n.js which expects this format - we use l10n.js as a wrapper between chrome & content; to work and provide a similar interface to the gaia one that standalone uses.
We haven't used the dot format in loop.properties as we're not using the l10n.js code to translate elements - as we're filling the strings in dynamically.
If we can keep some of the existing interface to the content code, and simplify the backend, I'm all for that.
Assignee | ||
Updated•10 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Assignee | ||
Comment 2•10 years ago
|
||
Assignee: nobody → mdeboer
Status: NEW → ASSIGNED
Flags: needinfo?(mmucci)
Attachment #8526028 -
Flags: review?(nperriault)
Assignee | ||
Updated•10 years ago
|
Iteration: --- → 36.3
Points: --- → 1
Updated•10 years ago
|
backlog: --- → Fx36+
Priority: -- → P2
Comment on attachment 8526028 [details] [diff] [review]
Patch v1: simplify l10n code in MozLoopService
Review of attachment 8526028 [details] [diff] [review]:
-----------------------------------------------------------------
Looks much better! Ship it :)
::: browser/components/loop/MozLoopService.jsm
@@ +681,5 @@
> /**
> * A getter to obtain and store the strings for loop. This is structured
> * for use by l10n.js.
> *
> + * @returns {Map} a map of element ids with localized string values
Nit: Missing full stop at line end.
@@ -709,3 @@
> }
>
> - return gLocalizedStrings = map;
Wow. Thanks for removing this.
Attachment #8526028 -
Flags: review?(nperriault) → review+
Assignee | ||
Comment 5•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Comment 7•10 years ago
|
||
Comment on attachment 8526028 [details] [diff] [review]
Patch v1: simplify l10n code in MozLoopService
Approval Request Comment
[Risks and why]: Loop rooms code needed for 35 pref-on. Avoids massive annoyance uplifting any other patches
Low risk, simplifies things
[String/UUID change made/needed]: none
Attachment #8526028 -
Flags: approval-mozilla-aurora?
Updated•10 years ago
|
Attachment #8526028 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 8•10 years ago
|
||
Updated•10 years ago
|
status-firefox35:
--- → fixed
status-firefox36:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•