intl.html revision 628b3b052ecff4d1843c7e919951413fbc03e79f
2058N/A<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2058N/A<html>
2058N/A<head>
2058N/A <title>Intl Test</title>
2058N/A <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
2058N/A</head>
2058N/A<body>
2058N/A <script src="/build/yui/yui.js"></script>
2058N/A
2058N/A <script>
2058N/A YUI({filter:"raw"}).use("node", "intl", function(Y) {
2058N/A
2058N/A var b = Y.Node.one("body");
2058N/A
2058N/A b.append("<p>Lookup Best Match:" + Y.Intl.lookupBestLang("fr-CA", ["en-US", "en-GB", "fr"]) + "</p>");
2058N/A
2058N/A Y.Intl.after("intl:langChange", function(e) {
2058N/A b.append("<p><em>Language changed to: " + Y.Intl.getLang(e.module) + "</em></p>");
2058N/A });
2058N/A
3661N/A Y.Intl.add("mystrings", "en-US", {
2058N/A hello:"Hello"
2058N/A });
2058N/A
2058N/A b.append("<p>Hello (en-US):" + Y.Intl.get("mystrings").hello + "</p>");
2058N/A
2058N/A Y.Intl.add("mystrings", "fr", {
2058N/A hello:"Bonjour"
2058N/A });
2058N/A
2058N/A b.append("<p>Hello (fr):" + Y.Intl.get("mystrings").hello + "</p>");
2058N/A
2058N/A Y.Intl.add("mystrings", "ja-JP", {
2058N/A hello: "こんにちは"
3661N/A });
3661N/A
3778N/A b.append("<p>Hello (ja-JP):" + Y.Intl.get("mystrings").hello + "</p>");
3778N/A
3778N/A // Intended to be called through Y.use() [ Y.use will pull down the bundle if it's not loaded, or just call _setLang ]
2058N/A Y.Intl._setLang("mystrings", "fr");
2058N/A
2058N/A b.append("<p>Hello (back to fr):" + Y.Intl.get("mystrings").hello + "</p>");
2058N/A
2058N/A
2058N/A });
2058N/A </script>
2058N/A</body>
2058N/A</html>