zbraniecki/l20n — Issue #9: Standardize XML API
Author: zbraniecki
Created: 2012-01-31 18:56:08+00:00
State: open

We're getting more and more attributes that should be stored (and usually exposed) on HTMLElement or HTMLDocument. It worries me a lot and I'd like to minimize the amount of common attribute space pollution caused by L20n.

My proposal is:

HTMLDocument.l10n.retranslate - a method that fires retranslation of the whole document
HTMLDocument.l10n.data - an attribute that exposes JSON structure with document context data
HTMLDocument.l10n.ctx - an attribute that exposes the L20n context used for document localization

HTMLElement.l10n.retranslate - a method that fires retranslation of the node
HTMLElement.l10n.data - an attribute that exposes JSON structure with the node context data (live object generated from l10n-args attribute)
HTMLElement.l10n.status - potentially an attribute that stores that localization status of the element

HTMLElement.l10nId - value of l10n-id attribute
HTMLElement.l10nArgs - value of l10n-args attribute
HTMLElement.l10nAttrs - value of l10n-attrs attribute
HTMLElement.l10nPath - value of l10n-path attribute

The major difference is that everything that is not set on the DOM via HTML code is being moved under "l10n" attribute in order to limit pollution.

Opinions?