<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.mozilla.org/index.php?action=history&amp;feed=atom&amp;title=Jetpack%2FFeatures%2FLocalization</id>
	<title>Jetpack/Features/Localization - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mozilla.org/index.php?action=history&amp;feed=atom&amp;title=Jetpack%2FFeatures%2FLocalization"/>
	<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Jetpack/Features/Localization&amp;action=history"/>
	<updated>2026-05-19T00:23:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://wiki.mozilla.org/index.php?title=Jetpack/Features/Localization&amp;diff=379410&amp;oldid=prev</id>
		<title>MykMelez: first draft</title>
		<link rel="alternate" type="text/html" href="https://wiki.mozilla.org/index.php?title=Jetpack/Features/Localization&amp;diff=379410&amp;oldid=prev"/>
		<updated>2011-12-16T01:07:25Z</updated>

		<summary type="html">&lt;p&gt;first draft&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Jetpack features include HTML5 files with locale-specific strings. The strings need to be localizable.&lt;br /&gt;
&lt;br /&gt;
The Mozilla platform supports localizing XUL and XHTML files via DTDs, but it doesn&amp;#039;t support localizing HTML5 files that way.&lt;br /&gt;
&lt;br /&gt;
Jetpack feature developers prize HTML5 and want to keep using it. They fear XHTML&amp;#039;s extant restrictions and future stagnation.&lt;br /&gt;
&lt;br /&gt;
Localizers, on the other hand, value the existing support for localizations, around which they have built toolchains.&lt;br /&gt;
&lt;br /&gt;
So we want a way to localize HTML5 pages that reuses as much of the platform&amp;#039;s existing localization support as possible.&lt;br /&gt;
&lt;br /&gt;
== Proposal ==&lt;br /&gt;
&lt;br /&gt;
We implement a stream converter that processes streams of Jetpack feature HTML5 files as they are being loaded, replacing string references with localized strings.  Files that wish to be localized identify themselves via a [file extension, sniffable initial string].&lt;br /&gt;
&lt;br /&gt;
The converter loads localized strings from string bundles (.properties files) identified by the HTML5 files.&lt;br /&gt;
&lt;br /&gt;
The syntax for identifying string bundles and referencing strings is [entity references (&amp;amp;reference;), mustaches (&amp;lt;nowiki&amp;gt;{{reference}}&amp;lt;/nowiki&amp;gt;), dollarinkles (${reference})].&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
We considered implementing a custom protocol like l10n:, but doing so presents a couple of issues:&lt;br /&gt;
* There are security restrictions on content from the custom protocol loading content at other protocols, like resource: or chrome: (f.e. to reference scripts, images, and other files that should not be localized).&lt;br /&gt;
* Developers want to use JavaScript libraries like jQuery. asuth and jrburke have previously used jQuery in HTML5 files at resource: URLs, and they worked fine. But jQuery assumes URLs succeed the scheme part with slashes, so any custom protocol we implement would have to include such slashes to be jQuery-compatible.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* [http://stephenwalther.com/blog/archive/2010/11/30/an-introduction-to-jquery-templates.aspx Stephen Walther: An Introduction to jQuery Templates]&lt;br /&gt;
* [http://documentcloud.github.com/underscore/ Underscore]&lt;br /&gt;
* [https://github.com/janl/mustache.js#readme mustache.js]&lt;br /&gt;
* [http://wiki.ecmascript.org/doku.php?id=harmony:quasis EcmaScript Quasi-Literals]&lt;br /&gt;
* [http://js-quasis-libraries-and-repl.googlecode.com/svn/trunk/safetemplate.html Using type inference to make web templates robust against XSS]&lt;/div&gt;</summary>
		<author><name>MykMelez</name></author>
	</entry>
</feed>