Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter <Peter.Gijsels@gmail.com>2010-02-27 23:02:43 (GMT)
committer Peter <Peter.Gijsels@gmail.com>2010-02-27 23:02:43 (GMT)
commitadfc466f5166a40e58afbfdb295e480a6e2e99c9 (patch)
treee77a6ae06f0538c73c38d888ddf07a727ede6142
parent7a995451f8fe8dc10d1d12e4d5831208473dba8a (diff)
first steps to internationalize 6_Maths_matchingAnglesAndShapes
-rwxr-xr-xexamples/6_Maths_matchingAnglesAndShapes/index.html1
-rwxr-xr-xexamples/6_Maths_matchingAnglesAndShapes/js/lesson.js26
-rw-r--r--examples/6_Maths_matchingAnglesAndShapes/js/messages.js35
-rw-r--r--js/jquery.i18n.js4
4 files changed, 61 insertions, 5 deletions
diff --git a/examples/6_Maths_matchingAnglesAndShapes/index.html b/examples/6_Maths_matchingAnglesAndShapes/index.html
index 08d851b..016b878 100755
--- a/examples/6_Maths_matchingAnglesAndShapes/index.html
+++ b/examples/6_Maths_matchingAnglesAndShapes/index.html
@@ -19,6 +19,7 @@
<script type="text/javascript" src="../../js/ui.kFooter.ne.json"></script>
<script type="text/javascript" src="../../js/ui.feedback.js"></script>
<script type="text/javascript" src="../../js/karma.js"></script>
+ <script type="text/javascript" src="js/messages.js"></script>
<script type="text/javascript" src="js/lesson.js"></script>
</head>
diff --git a/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js b/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js
index 46cbf77..d4e049d 100755
--- a/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js
+++ b/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js
@@ -1,5 +1,25 @@
-$(document).ready(function() {
+/*
+Bugs (firefox 3.5.7):
+* sometimes multiple cards are shown
+* the image of one of the angles is not showing properly
+* if you have a text without a hyphen it doesn't work (e.g. angulo
+recto iso angulo-recto)
+* the text for angulo-obtuso is not displaying properly
+* title in english: 'matching angles with shapes' should maybe be
+'matching angles and shapes'
+
+Questions:
+* how do we set locale? cfr beginning of $(document).ready()
+
+Peeves:
+* tabs for indenting
+* trailing whitespace everywhere
+*/
+
+$(document).ready(function() {
+ $.i18n.setLocale('es');
+ var _ = $._;
var i = 0, j = 0, flag = 0;
var s=0, m=0, h=0;
var clickedObjects = []; //array storing the clicks of the two succesive clicks
@@ -14,14 +34,14 @@ $(document).ready(function() {
var restart = 0; //not restarted
var clickCounter = 0;
var NUM_OBJECTS = 24; //total number of objects in the game
- var shapes_angles = new Array('Acute-Angle','Right-Angle','Obtuse-Angle','Triangle','Square','Rhombus','Rectangle','Parallelogram','Pentagon','Hexagon','Septagon','Octagon','Acute-Angle','Right-Angle','Obtuse-Angle','Triangle','Square','Rhombus','Rectangle','Parallelogram','Pentagon','Hexagon','Septagon','Octagon');
+ var shapes_angles = new Array('Acute-Angle','Right-Angle','Obtuse-Angle','Triangle','Square','Rhombus','Rectangle','Parallelogram','Pentagon','Hexagon','Septagon','Octagon',_('Acute-Angle'),_('Right-Angle'),_('Obtuse-Angle'),_('Triangle'),_('Square'),_('Rhombus'),_('Rectangle'),_('Parallelogram'),_('Pentagon'),_('Hexagon'),_('Septagon'),_('Octagon'));
//var section = $('#section');
var $content = $('#content');
var shapes; //store the current shape or angle name
Karma.scaleWindow();
- $('#kHeader').kHeader({title:"Maths: Matching Angles with Shapes"});
+ $('#kHeader').kHeader({title:_("Maths: Matching Angles with Shapes")});
var $kFooter = $('#kFooter').kFooter({scoreboard: false, startButton: true,
pauseButton: true, restartButton: true, timer: true});
diff --git a/examples/6_Maths_matchingAnglesAndShapes/js/messages.js b/examples/6_Maths_matchingAnglesAndShapes/js/messages.js
new file mode 100644
index 0000000..845f8ec
--- /dev/null
+++ b/examples/6_Maths_matchingAnglesAndShapes/js/messages.js
@@ -0,0 +1,35 @@
+/* -*- coding: utf-8 -*- */
+$.i18n.es = {};
+$.i18n.es.strings = {
+ 'Acute-Angle' : 'Ángulo-agudo',
+ 'Right-Angle' : 'Ángulo-recto',
+ 'Obtuse-Angle' : 'Ángulo-obtuso',
+ 'Triangle' : 'Triángulo',
+ 'Square' : 'Cuadrado',
+ 'Rhombus' : 'Rombo',
+ 'Rectangle' : 'Rectángulo',
+ 'Parallelogram' : 'Paralelogramo',
+ 'Pentagon' : 'Pentágono',
+ 'Hexagon' : 'Hexágono',
+ 'Septagon' : 'Heptágono',
+ 'Octagon' : 'Octágono',
+ 'Maths: Matching Angles with Shapes' : 'Matemáticas: reunir angulos y formas'
+};
+
+$.i18n.nl = {};
+$.i18n.nl.strings = {
+ 'Acute-Angle' : 'Scherpe hoek',
+ 'Right-Angle' : 'Rechte hoek',
+ 'Obtuse-Angle' : 'Stompe hoek',
+ 'Triangle' : 'Driehoek',
+ 'Square' : 'Vierkant',
+ 'Rhombus' : 'Ruit',
+ 'Rectangle' : 'Rechthoek',
+ 'Parallelogram' : 'Parallellogram',
+ 'Pentagon' : 'Vijfhoek',
+ 'Hexagon' : 'Zeshoek',
+ 'Septagon' : 'Zevenhoek',
+ 'Octagon' : 'Achthoek',
+ 'Maths: Matching Angles with Shapes' : 'Wiskunde: passende hoeken en vormen zoeken'
+};
+
diff --git a/js/jquery.i18n.js b/js/jquery.i18n.js
index db142c4..0543dcf 100644
--- a/js/jquery.i18n.js
+++ b/js/jquery.i18n.js
@@ -9,10 +9,10 @@
$.i18n = function(string, locale){
var lang = locale || $.i18n.lang;
- if (!this.i18n[lang] || !this.i18n[lang].strings){
+ if (!$.i18n[lang] || !$.i18n[lang].strings){
return string;
}
- return this.i18n[lang].strings[string]||string;
+ return $.i18n[lang].strings[string]||string;
};
$._ = $.i18n;