Closed Bug 704671 Opened 14 years ago Closed 9 years ago

Add L20n bindings for HTML5

Categories

(Core :: Internationalization: Localization, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: zbraniecki, Assigned: zbraniecki)

References

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Attached patch WIP 1 (obsolete) — Splinter Review
WIP that works with code from bug 704500 to make HTML5 localizable
Assignee: nobody → gandalf
Status: NEW → ASSIGNED
Attachment #576343 - Flags: feedback?(hsivonen)
Version: unspecified → Trunk
Attached patch WIP 1Splinter Review
d'uh, that was just hg stat, not hg diff. Proper WIP patch
Attachment #576343 - Attachment is obsolete: true
Attachment #576343 - Flags: feedback?(hsivonen)
Attachment #576344 - Flags: feedback?(hsivonen)
Comment on attachment 576344 [details] [diff] [review] WIP 1 > } else if (nsHtml5Atoms::link == aName) { > nsString* rel = aAttributes->getValue(nsHtml5AttributeName::ATTR_REL); >+ nsString* type = aAttributes->getValue(nsHtml5AttributeName::ATTR_TYPE); > // Not splitting on space here is bogus but the old parser didn't even > // do a case-insensitive check. > if (rel && rel->LowerCaseEqualsASCII("stylesheet")) { > nsString* url = aAttributes->getValue(nsHtml5AttributeName::ATTR_HREF); > if (url) { > nsString* charset = aAttributes->getValue(nsHtml5AttributeName::ATTR_CHARSET); > mSpeculativeLoadQueue.AppendElement()->InitStyle(*url, > (charset) ? *charset : EmptyString()); > } >+ } else if (type && type->LowerCaseEqualsASCII("intl/l20n")) { Instead of dispatching on the type attribute and minting a new mediatype (if you do mint a new media type, it should be text/l20n, not intl/l20n), it would make more sense to mint a new rel token, such as "l10n" and check for that. (Note that in principle, you should check if any space-separated token in the rel value matches your token. The stylesheet check above is only an optimization and, therefore, cheats and doesn't deal with rel values that have multiple tokens.) >+ if (localName->Equals(NS_LITERAL_STRING("l10n-id"))) { You should add l10n-id to nsGkAtomList and then do a pointer comparison between localName and nsGkAtoms::l10nid here. >+ case eTreeOpL20nResourceAdded: { >+ PRUnichar* buffer = mOne.unicharPtr; You need to add case eTreeOpL20nResourceAdded: to the part of the nsHtml5TreeOperation's destructor that delete[]s mOne.unicharPtr; Also, since this isn't ready to be exposed to Web content without the shadow tree stuff, this implementation needs a check to see if the document is a chrome doc so that the l20n stuff only runs for chrome docs until we are ready to expose this to Web content in general.
Attachment #576344 - Flags: feedback?(hsivonen) → feedback+
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: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: