<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Internationalization: How to Localize HTML5 Projects?</title>
	<atom:link href="http://www.ab-weblog.com/en/internationalization-how-to-localize-html5-projects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ab-weblog.com/en/internationalization-how-to-localize-html5-projects/</link>
	<description>Andreas Breitschopp</description>
	<lastBuildDate>Fri, 04 Jan 2013 06:48:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Andreas Breitschopp</title>
		<link>http://www.ab-weblog.com/en/internationalization-how-to-localize-html5-projects/#comment-259</link>
		<dc:creator>Andreas Breitschopp</dc:creator>
		<pubDate>Mon, 16 Jul 2012 07:26:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.ab-weblog.com/en/?p=400#comment-259</guid>
		<description>Hello CyrusP,

thank you for posting your addition to my code!

Best regards
Andreas</description>
		<content:encoded><![CDATA[<p>Hello CyrusP,</p>
<p>thank you for posting your addition to my code!</p>
<p>Best regards<br />
Andreas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CyrusP</title>
		<link>http://www.ab-weblog.com/en/internationalization-how-to-localize-html5-projects/#comment-258</link>
		<dc:creator>CyrusP</dc:creator>
		<pubDate>Sun, 15 Jul 2012 00:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.ab-weblog.com/en/?p=400#comment-258</guid>
		<description>Hi,

In order to get all JSON lang data from a server-side response, I have modified a bit your sample code.

With this &quot;feature&quot;, you can use &quot;key&quot; instead of a real string in the code (html or js). So you can get all of strings from any Url witch respond the appropriate json response.
 
Here, the function loaded() gets the value of lang attribute in HTML tag. Then put this value in String.locale. So localization aims to load the associated JSON file even no parameter found in URL.

In the script.js :

function loaded()
{
       //The default HTML lang
	var getDefaultLang = document.documentElement.lang;
	
	var lang = getParameterValue(&quot;lang&quot;);
	if (lang != &quot;&quot;) String.locale = lang;

        //Set if there&#039;s no parameter in URL
	else  String.locale = getDefaultLang;
	
        //Put key instead hard string, here a new format like #{string_localize} can be
        //better to read the code
	alert(_(&quot;string_localize_init&quot;));
	document.title = _(document.title);

	alert(_(&quot;string_localize_other&quot;));
	localizeHTMLTag(&quot;headertext&quot;);
	localizeHTMLTag(&quot;subtitletext&quot;);
	localizeHTMLTag(&quot;showinenglish&quot;);
	localizeHTMLTag(&quot;showingerman&quot;);

	alert(_(&quot;string_localize_done&quot;));
}

In the index.html file :

&lt;!-- My lang by default - REQUIRED NOW--&gt;


	
      
        &lt;!-- And don&#039;t forget the new key string --&gt;
	inter_test
	
&lt;!-- All ressource files, even default --&gt;
	
	
...

fr.json : 


{
	&quot;inter_test&quot;: &quot;Test internationalisation...&quot;,
	&quot;string_text&quot;: &quot;Ceci est un test d&#039;internationalisation !&quot;,
	&quot;string_subtitle&quot;: &quot;Avec sous titre&quot;,
	&quot;show&quot;: &quot;Voir en Anglais&quot;,
	&quot;string_show_french&quot;: &quot;Voir en Francais&quot;,
	&quot;string_localize_init&quot;: &quot;Init title du document...&quot;,
	&quot;string_localize_other&quot;: &quot;Init HTML Tags...&quot;,
	&quot;string_localize_done&quot;: &quot;Localisation terminée !&quot;
}


en.json : 

{
	&quot;inter_test&quot;: &quot;Internationalization Test&quot;,
	&quot;string_text&quot;: &quot;This is an Internationalization Test!&quot;,
	&quot;string_subtitle&quot;: &quot;With any subtitle.&quot;,
	&quot;show&quot;: &quot;Show in French&quot;,
	&quot;string_show_french&quot;: &quot;Show in English&quot;,
	&quot;string_localize_init&quot;: &quot;Localizing the document title...&quot;,
	&quot;string_localize_other&quot;: &quot;Localizing other HTML tags...&quot;,
	&quot;string_localize_done&quot;: &quot;Localizing done!&quot;
}

Pe@ce and thx for this pretty cool how to :)</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>In order to get all JSON lang data from a server-side response, I have modified a bit your sample code.</p>
<p>With this &#8220;feature&#8221;, you can use &#8220;key&#8221; instead of a real string in the code (html or js). So you can get all of strings from any Url witch respond the appropriate json response.</p>
<p>Here, the function loaded() gets the value of lang attribute in HTML tag. Then put this value in String.locale. So localization aims to load the associated JSON file even no parameter found in URL.</p>
<p>In the script.js :</p>
<p>function loaded()<br />
{<br />
       //The default HTML lang<br />
	var getDefaultLang = document.documentElement.lang;</p>
<p>	var lang = getParameterValue(&#8220;lang&#8221;);<br />
	if (lang != &#8220;&#8221;) String.locale = lang;</p>
<p>        //Set if there&#8217;s no parameter in URL<br />
	else  String.locale = getDefaultLang;</p>
<p>        //Put key instead hard string, here a new format like #{string_localize} can be<br />
        //better to read the code<br />
	alert(_(&#8220;string_localize_init&#8221;));<br />
	document.title = _(document.title);</p>
<p>	alert(_(&#8220;string_localize_other&#8221;));<br />
	localizeHTMLTag(&#8220;headertext&#8221;);<br />
	localizeHTMLTag(&#8220;subtitletext&#8221;);<br />
	localizeHTMLTag(&#8220;showinenglish&#8221;);<br />
	localizeHTMLTag(&#8220;showingerman&#8221;);</p>
<p>	alert(_(&#8220;string_localize_done&#8221;));<br />
}</p>
<p>In the index.html file :</p>
<p><!-- My lang by default - REQUIRED NOW--></p>
<p>        <!-- And don't forget the new key string --><br />
	inter_test</p>
<p><!-- All ressource files, even default --></p>
<p>&#8230;</p>
<p>fr.json : </p>
<p>{<br />
	&#8220;inter_test&#8221;: &#8220;Test internationalisation&#8230;&#8221;,<br />
	&#8220;string_text&#8221;: &#8220;Ceci est un test d&#8217;internationalisation !&#8221;,<br />
	&#8220;string_subtitle&#8221;: &#8220;Avec sous titre&#8221;,<br />
	&#8220;show&#8221;: &#8220;Voir en Anglais&#8221;,<br />
	&#8220;string_show_french&#8221;: &#8220;Voir en Francais&#8221;,<br />
	&#8220;string_localize_init&#8221;: &#8220;Init title du document&#8230;&#8221;,<br />
	&#8220;string_localize_other&#8221;: &#8220;Init HTML Tags&#8230;&#8221;,<br />
	&#8220;string_localize_done&#8221;: &#8220;Localisation terminée !&#8221;<br />
}</p>
<p>en.json : </p>
<p>{<br />
	&#8220;inter_test&#8221;: &#8220;Internationalization Test&#8221;,<br />
	&#8220;string_text&#8221;: &#8220;This is an Internationalization Test!&#8221;,<br />
	&#8220;string_subtitle&#8221;: &#8220;With any subtitle.&#8221;,<br />
	&#8220;show&#8221;: &#8220;Show in French&#8221;,<br />
	&#8220;string_show_french&#8221;: &#8220;Show in English&#8221;,<br />
	&#8220;string_localize_init&#8221;: &#8220;Localizing the document title&#8230;&#8221;,<br />
	&#8220;string_localize_other&#8221;: &#8220;Localizing other HTML tags&#8230;&#8221;,<br />
	&#8220;string_localize_done&#8221;: &#8220;Localizing done!&#8221;<br />
}</p>
<p>Pe@ce and thx for this pretty cool how to <img src='http://www.ab-weblog.com/en/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MunichJS: Speech About Internationalization of HTML5 Apps and Using Encapsulator &#124; AB-WebLog.com</title>
		<link>http://www.ab-weblog.com/en/internationalization-how-to-localize-html5-projects/#comment-152</link>
		<dc:creator>MunichJS: Speech About Internationalization of HTML5 Apps and Using Encapsulator &#124; AB-WebLog.com</dc:creator>
		<pubDate>Wed, 07 Mar 2012 23:28:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.ab-weblog.com/en/?p=400#comment-152</guid>
		<description>[...] example project used in my presentation can be downloaded in my post Internationalization: How to Localize HTML5 Projects?. Tweet(function() { var po = document.createElement(&#039;script&#039;); po.type = &#039;text/javascript&#039;; [...]</description>
		<content:encoded><![CDATA[<p>[...] example project used in my presentation can be downloaded in my post Internationalization: How to Localize HTML5 Projects?. Tweet(function() { var po = document.createElement(&#039;script&#039;); po.type = &#039;text/javascript&#039;; [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->