Re: Question related to Recommendation/Best Practice/Relevant Discussions for "Translation-relevant content related to 'script' element in HTML"

> What we can propose is to separate all such translatable content into separate script elements marked by ITS as translateable, something like:
> 
> <script id="PLEASE_WAIT" type="text/plain" its-translate="yes">Please <em>wait</em> ...</script>
> 
> <script type="text/javascript">
> function x(){
> if (document.getElementById("y").innerHTML !=
> document.getElementById("PLEASE_WAIT").innerText ) { }
> }
> </script>
> 
> That way you can use standard ITS processing even for localizing strings
> inside Javascript with little runtime overhead.
> 
> 				Jirka

This seems like a particularly elegant approach to handling this issue. And it one wanted to you could essentially combine it with Christian’s method to store multiple localizations by simply having ID values like "PLEASE_WAIT-de" where a modest processing layer updates the ID by looking at the locale to pull the appropriate piece of content.

Best,

Arle

Received on Tuesday, 20 August 2013 09:26:22 UTC