Add an API for interaction with document's l10n-data

RESOLVED INCOMPLETE

Status

()

Core
DOM
RESOLVED INCOMPLETE
7 years ago
7 months ago

People

(Reporter: gandalf, Assigned: gandalf)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

7 years ago
Once bug 566906 is solved, we should add an API for interaction with l10n-data object of the document.

My proposal is to go for:

document.mozL10nData.get('id')
document.mozL10nData.set('id', 'value') - where value has to be int or string.

Pike proposes:

document.mozL10nReadJSON(json) - which will just overwrite the whole l10n-data structure with a new JSON one.
(Assignee)

Updated

7 years ago
Assignee: nobody → gandalf
Blocks: 595812
Depends on: 566906
(In reply to comment #0)
> Once bug 566906 is solved, we should add an API for interaction with l10n-data
> object of the document.
> 
> My proposal is to go for:
> 
> document.mozL10nData.get('id')
> document.mozL10nData.set('id', 'value') - where value has to be int or string.

In this case, please please please go for

foo = mozL10nData['id']
mozL10nData['id'] = bar

Is this exposed to web content?
(Assignee)

Comment 2

7 years ago
(In reply to comment #1)
> (In reply to comment #0)
> > document.mozL10nData.get('id')
> > document.mozL10nData.set('id', 'value') - where value has to be int or string.
> 
> In this case, please please please go for
> 
> foo = mozL10nData['id']
> mozL10nData['id'] = bar

That's an implementation detail. We'll have to use getter and setter anyway in such case.

> Is this exposed to web content?

not now. That's an API for XUL localization. In the future we will want to find ways to work with HTML5 and this may be exposed there then, but I'm not sure if we'll go for web content or just chrome content.
Component: DOM: Mozilla Extensions → DOM
Product: Core → Core
(Assignee)

Comment 3

7 months ago
Seven years later, we're making another attempt to refactor our l10n layer.

The new tracking bug is bug 1365426 and I'll mark the previous effort as "INCOMPLETE".
Status: NEW → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.