From b0ae77c94fe9b857538bd983092f02a474a423dd Mon Sep 17 00:00:00 2001 From: Bryan Berry Date: Sun, 28 Feb 2010 15:12:08 +0000 Subject: rework messages.json file for spanish --- diff --git a/examples/6_Maths_matchingAnglesAndShapes/index.html b/examples/6_Maths_matchingAnglesAndShapes/index.html index da1cee4..5239fc0 100755 --- a/examples/6_Maths_matchingAnglesAndShapes/index.html +++ b/examples/6_Maths_matchingAnglesAndShapes/index.html @@ -10,15 +10,14 @@ + + - - - diff --git a/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js b/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js index 5bff562..8aef7d8 100755 --- a/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js +++ b/examples/6_Maths_matchingAnglesAndShapes/js/lesson.js @@ -117,7 +117,7 @@ $(document).ready(function() { play = 0; $('#content').html(''); $('#content').append('
GAME OVER
Congratulations!!!
'); - $('#content').append($(document.createElement('div')) + /* $('#content').append($(document.createElement('div')) .attr({id: 'gameOverInfo'}) // clicks < 2 is impossible .html(format($.i18n.ngettext('You have completed the game in %d clicks within %d hour,', @@ -131,7 +131,7 @@ $(document).ready(function() { + format ($.i18n.ngettext('%d second.', '%d seconds.', s), - s))); + s))); */ } }; diff --git a/examples/6_Maths_matchingAnglesAndShapes/js/messages.es.json b/examples/6_Maths_matchingAnglesAndShapes/js/messages.es.json index bad90a9..f889468 100644 --- a/examples/6_Maths_matchingAnglesAndShapes/js/messages.es.json +++ b/examples/6_Maths_matchingAnglesAndShapes/js/messages.es.json @@ -2,7 +2,7 @@ $.i18n.es = {}; $.i18n.es.strings = { "default":{ - 'Acute-Angle' : 'Ángulo-agudo', + 'Acute-Angle' : 'Ángulo-agudo', 'Right-Angle' : 'Ángulo-recto', 'Obtuse-Angle' : 'Ángulo-obtuso', 'Triangle' : 'Triángulo', @@ -31,16 +31,20 @@ $.i18n.es.strings = { } }; -$(function() { $.i18n.setLocale('es'); }); +(function() { $.i18n.setLocale('es'); })(); + + $.i18n.setLocale('es'); // You can put these inside the dict above, but for now this will be easier to merge. -$.i18n.es.strings['You have completed the game in %d clicks within %d hour,'] = + + +$.i18n.es.strings['default']['You have completed the game in %d clicks within %d hour,'] = ['Has acabado el juego en %d clics en %d hora,', 'Has acabado el juego en %d clics en %d horas,']; -$.i18n.es.strings['%d minute and '] = +$.i18n.es.strings['default']['%d minute and '] = ['%d minuto y ', '%d minutos y ']; -$.i18n.es.strings['%d second.'] = +$.i18n.es.strings['default']['%d second.'] = ['%d segundo.', '%d segundos.']; diff --git a/examples/English_Animal_Identification/index.html b/examples/English_Animal_Identification/index.html index a19bbef..e08f815 100755 --- a/examples/English_Animal_Identification/index.html +++ b/examples/English_Animal_Identification/index.html @@ -17,7 +17,7 @@ src="../../js/ui.core-draggable-resizable-dialog.js"> - + diff --git a/js/jquery.i18n.js b/js/jquery.i18n.js index 2df5e53..4eb303f 100644 --- a/js/jquery.i18n.js +++ b/js/jquery.i18n.js @@ -27,18 +27,18 @@ // You can override this in messages..json. $.i18n.choose_pluralized_msg = function (choices, n) { return n == 1 ? choices[0] : choices[1]; - } + }; $.i18n.ngettext = function (msgid1, msgid2, n) { var lang = $.i18n.lang; if (!$.i18n[lang] || !$.i18n[lang].strings) { - return $.choose_pluralized_msg([msgid1, msgid2], n); + return $.i18n.choose_pluralized_msg([msgid1, msgid2], n); } // Is using msgid1 as the key ok? return $.i18n.choose_pluralized_msg($.i18n[lang].strings[msgid1] || [msgid1, msgid2], - n) - } + n); + }; $._ = $.i18n; $._c = $.i18n.cgettext; -- cgit v0.9.1