Closed Bug 611095 Opened 14 years ago Closed 7 years ago

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

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: zbraniecki, Assigned: zbraniecki)

References

Details

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: 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?
(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
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
Closed: 7 years ago
Resolution: --- → INCOMPLETE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.