Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: kig/js-i18n
base: 6cf6a17eeb
...
head fork: kig/js-i18n
compare: 933fd17f83
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Showing with 3,590 additions and 8 deletions.
  1. +1 −1  external.js
  2. +3 −4 index.html
  3. +3,585 −1 js-i18n.js
  4. +1 −2  test_i18n.html
View
2  external.js
@@ -1,4 +1,4 @@
-"lang fi-FI";
+"lang fi";
(funktio() {
View
7 index.html
@@ -104,12 +104,12 @@
<h3>Usage</h3>
<p>First, add the JS-i18n script to your page:
- <p><pre>&lt;script src="esprima.js">&lt;/script><br>&lt;script src="js-i18n.js">&lt;/script></pre>
+ <p><pre>&lt;script src="js-i18n.js">&lt;/script></pre>
- <p>Next, create a script tag with type="text/js-i18n" and lang="fi-FI" (replacing "fi-FI" with your desired locale, naturally). You're now ready to write localised JavaScript. You can also add the quoted string "lang fi-FI" at the start of the localised JavaScript file to set the script's locale.
+ <p>Next, create a script tag with type="text/js-i18n" and lang="fi" (replacing "fi" with your desired locale, naturally). You're now ready to write localised JavaScript. You can also add the quoted string "lang fi" at the start of the localised JavaScript file to set the script's locale.
<p><pre>&lt;script type="text/js-i18n">
- "lang fi-FI";
+ "lang fi";
hälytä("Terve maailma!");
@@ -124,7 +124,6 @@
<p>The translator works by substituting defined keywords and identifiers for their translated versions. It's not perfect, but it's surprisingly comfortable. The non-Finnish translations are from <a href="http://www.babylscript.com">BabylScript</a>, which is an awesome JavaScript translation project that you should check out.
</div>
</div>
- <script src="esprima.js"></script>
<script src="js-i18n.js"></script>
<script>
document.getElementById('run').onclick = function() {
View
3,586 js-i18n.js
3,585 additions, 1 deletion not shown
View
3  test_i18n.html
@@ -2,12 +2,11 @@
<head>
<title>Translation test</title>
<meta charset="utf-8">
- <script src="esprima.js"></script>
<script src="js-i18n.js" charset="utf-8"></script>
</head>
<body>
<h1 id="otsikko">Not working yet</h1>
- <script type="text/js-i18n" lang="fi-FI">
+ <script type="text/js-i18n" lang="fi">
muu otsikko = asiakirja.haeElementtiIdllä('otsikko');
otsikko.sisäHTML = otsikko.sisäHTML.korvaa('Not w', 'W').korvaa('yet', 'now');
</script>

No commit comments for this range

Something went wrong with that request. Please try again.