Closed
Bug 1083837
Opened 11 years ago
Closed 7 years ago
Clean up the node after removeAttribute('data-l10n-id')
Categories
(Firefox OS Graveyard :: Gaia::L10n, defect)
Firefox OS Graveyard
Gaia::L10n
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: zbraniecki, Unassigned)
References
Details
It should be possible to get the entity and remove localizable attributes and optionally the value.
| Reporter | ||
Comment 1•11 years ago
|
||
Until we have a platform solution, one way to approach that would be to:
1) Get the entity in the old language
2) Clean up the value if the old entity has value
3) Clean up attributes that the old entity has
From there if the procedure is to set new locale, proceed to that, if it was a result of l10nId removal, we're done.
I'm a bit worried about performance impact in case of language change because this code would launch for all translatable nodes in the document.
Comment 2•11 years ago
|
||
(In reply to Zibi Braniecki [:gandalf] from comment #1)
> Until we have a platform solution, one way to approach that would be to:
>
> 1) Get the entity in the old language
> 2) Clean up the value if the old entity has value
> 3) Clean up attributes that the old entity has
This sounds good. Should we add an internal API for getting all public fields of an entity? I assume there's no need to actually resolve any of them; we need just the names.
> I'm a bit worried about performance impact in case of language change
> because this code would launch for all translatable nodes in the document.
Would it be possible to not clear value/attrs right away and only do this once the mutation observer translates the node into the new language? This way we could avoid the clearing step if there's a translation to be inserted anyways. Something like a WeakMap with nodes as keys and names of fields to clear as values could do the trick.
Comment 4•7 years ago
|
||
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•