Skip to content

Instantly share code, notes, and snippets.

@dorkalev
Created April 30, 2010 00:30
Show Gist options
  • Save dorkalev/384507 to your computer and use it in GitHub Desktop.
Save dorkalev/384507 to your computer and use it in GitHub Desktop.
on the client side's HTML HEAD tag you include:
<script src="/dictionary.js" type="text/javascript" charset="utf-8"></script>
<script>
var current_language = "italian";
</script>
you manage current_language variable according to user's langauge
and where translated text is needed you use the amazing <dictkey> tag:
<dictkey>hello</dictkey>
or 'dictkeyatt' attribute that indicates which attribute of the element contains a value that should be translated:
<input type="submit" value="submit" dictkeyatt="value" />
you will see that:
<dictkey>hello</dictkey> CHANGES TO <dictkey>ciao</dictkey>
and
<input type="submit" value="submit" dictkeyatt="value" /> CHANGES TO <input type="submit" value="vai" dictkeyatt="value" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment