Permalink
Browse files

hook up text/js-i18n scripts to be auto-translated, test

  • Loading branch information...
1 parent a024232 commit 02f8609fd81ea33ae96c35add682d81bdc9cf95e @kig committed Jul 29, 2012
Showing with 464 additions and 0 deletions.
  1. +23 −0 external.js
  2. +36 −0 index.html
  3. +389 −0 js-i18n.js
  4. +16 −0 test_i18n.html
View
@@ -0,0 +1,23 @@
+(funktio() {
+
+ function lisääKappale(teksti) {
+ muu kappale = asiakirja.luoElementti("p");
+
+ kappale.lisääLapsi(asiakirja.luoTekstiSolmu(teksti));
+ asiakirja.runko.lisääLapsi(kappale);
+ };
+
+ lisääKappale("This paragraph was added by an external script.");
+
+ muu lapset = asiakirja.runko.lapsiSolmut;
+
+ joka (muu i=0; i<lapset.pituus; i++) {
+ muu lapsi = lapset[i];
+ jos (lapsi.tyyli) {
+ lapsi.tyyli.väri = '#004400';
+ }
+ }
+
+ lisääKappale("The above elements were coloured by the external script as well.");
+
+})();
View
@@ -20,6 +20,8 @@
From <select id="locale">
<option>fi-FI</option>
<option>en-US</option>
+ <option>ja-JP</option>
+ <option>fr-FR</option>
<option>Custom</option>
</select>
<textarea id="source">
@@ -58,6 +60,7 @@
<option>ja-JP</option>
<option>en-US</option>
<option>fi-FI</option>
+ <option>fr-FR</option>
<option>Custom</option>
</select>
<textarea id="javascript" disabled="disabled">Translation output</textarea>
@@ -171,6 +174,39 @@ <h3>Make your custom translation</h3>
'finally':'やっと'
}),
+'fr-FR': invert({
+'function':'fonction',
+'if':'si',
+'else':'sinon',
+'for':'pour',
+'while':'tantque',
+'return':'retourner',
+'do':'faire',
+'true':'vrai',
+'false':'faux',
+'var':'var',
+'in':'dans',
+'let':'soit',
+'new':'nouveau',
+'try':'essayer',
+'case':'cas',
+'null':'nul',
+'this':'ceci',
+'with':'avec',
+'break':'casser',
+'throw':'lancer',
+'catch':'capturer',
+'switch':'selon',
+'continue':'continuer',
+'debugger':'débogueur',
+'instanceof':'instancede',
+'typeof':'typede',
+'void':'vide',
+'delete':'effacer',
+'default':'défaut',
+'finally':'finalement'
+}),
+
'fi-FI': {
'jos':'if',
'johon':'in',
Oops, something went wrong.

0 comments on commit 02f8609

Please sign in to comment.