Closed
Bug 1210719
Opened 10 years ago
Closed 10 years ago
Create a bridge-enabled version of L20n for NGA
Categories
(Firefox OS Graveyard :: Gaia::L10n, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: stas, Assigned: stas)
References
Details
Attachments
(1 file)
It is time. The v3.x branch is in a good shape to support bridge-enabled apps. My plan is to split l20n into two files: l20n-service.js and l20n-client.js.
l20n-service:
- parser
- resolver & plurals
- resource fetching and caching (env)
- runtime qps
- language negotiation
l20n-client:
- dom translation & overlays
- document.l10n
- qps for explicitly pseudo-translating strings (I'll try to refactor this into the service, too, at a later date)
Assignee | ||
Comment 1•10 years ago
|
||
(In reply to Staś Małolepszy :stas from comment #0)
> l20n-client:
> - qps for explicitly pseudo-translating strings (I'll try to refactor this
> into the service, too, at a later date)
Bug 1210721.
Assignee | ||
Comment 2•10 years ago
|
||
Zibi, I think this is now ready for your review.
I wonder if there's a way to make the architecture simpler. Here's how it works right now:
- on the client, a document gets its view which exposes our public API,
- the view is part of the dom bindings and is the same for all runtimes,
- the view creates a tiny client which is runtime-specific and is responsible for connecting to the service,
- in the web runtime (oga), the client acts as a synchronous proxy between the view and the remote; the view calls client.method('foo') and the client translates that into remote.foo(),
- in the bridge runtime (nga), the client *is* the bridge.js client which connects to a bridge.js service; the service then talks to the l20n remote,
- the remote creates an env to store the resources and one context for each connected client.
The addition of client/service introduced a new layer of abstraction,but otherwise I think this makes sense. Still I'd love to get feedback on how to make this possibly simpler.
I'm also looking for suggestions regarding naming. Is Remote a good name? Should the new runtime be called 'bridge'? Perhaps 'nga' would be more fitting. Lastly, what should be the names of the dist files? I went for l20n-service and l20n-client, but I could see a case be made for shared/js/l20n/service.js and shared/js/l20n/client.js.
Comment 3•10 years ago
|
||
Comment on attachment 8668879 [details] [review]
Pull request
That's a masterpiece.
I love how many things come together that you've been steering architecturally ever since we started 3.x line.
I'm a bit mehy about the increase in OGA complexity, but since it seems there's no perf/memory impact which I'd expect, I like the elegance of the code.
Let's get it in master, and move Music to it!
Attachment #8668879 -
Flags: review?(gandalf) → review+
Assignee | ||
Comment 4•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•10 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•