From b01903202c3570f3af4788fe9b87a63846a0b914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Eixarch?= Date: Fri, 7 Dec 2012 05:24:40 +0100 Subject: Added new strings to translate for js files --- src/static/js/chat.js | 2 +- src/static/js/pad_editbar.js | 2 +- src/static/js/pad_impexp.js | 17 ++++++++++------- src/static/js/pad_savedrevs.js | 2 +- src/static/js/pad_userlist.js | 12 ++++++------ 5 files changed, 19 insertions(+), 16 deletions(-) (limited to 'src/static') diff --git a/src/static/js/chat.js b/src/static/js/chat.js index 4493ed15..225657c2 100644 --- a/src/static/js/chat.js +++ b/src/static/js/chat.js @@ -109,7 +109,7 @@ var chat = (function() } /* End of new action */ - var authorName = msg.userName == null ? "unnamed" : padutils.escapeHtml(msg.userName); + var authorName = msg.userName == null ? _('pad_userlist.unnamed') : padutils.escapeHtml(msg.userName); var html = "

" + authorName + ":" + timeStr + " " + text + "

"; $("#chattext").append(html); diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 24dd3d6f..f600ff09 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -169,7 +169,7 @@ var padeditbar = (function() { if ((!(ace.ace_getRep().selStart && ace.ace_getRep().selEnd)) || ace.ace_isCaret()) { - if (window.confirm("Clear authorship colors on entire document?")) + if (window.confirm(_("pad_editbar.clearcolors"))) { ace.ace_performDocumentApplyAttributesToCharRange(0, ace.ace_getRep().alltext.length, [ ['author', ''] diff --git a/src/static/js/pad_impexp.js b/src/static/js/pad_impexp.js index 4b4733a5..4fafd884 100644 --- a/src/static/js/pad_impexp.js +++ b/src/static/js/pad_impexp.js @@ -69,7 +69,7 @@ var padimpexp = (function() function fileInputSubmit() { $('#importmessagefail').fadeOut("fast"); - var ret = window.confirm("Importing a file will overwrite the current text of the pad." + " Are you sure you want to proceed?"); + var ret = window.confirm(_("pad_impexp.confirmimport")); if (ret) { hidePanelCall = paddocbar.hideLaterIfNoOtherInteraction(); @@ -85,7 +85,7 @@ var padimpexp = (function() $('#importsubmitinput').attr( { disabled: true - }).val("Importing..."); + }).val(_("pad_impexp.importing")); window.setTimeout(function() { $('#importfileinput').attr( @@ -106,7 +106,7 @@ var padimpexp = (function() function importDone() { - $('#importsubmitinput').removeAttr('disabled').val("Import Now"); + $('#importsubmitinput').removeAttr('disabled').val(_("pad_impexp.importbutton")); window.setTimeout(function() { $('#importfileinput').removeAttr('disabled'); @@ -130,14 +130,14 @@ var padimpexp = (function() var msg=""; if(status === "convertFailed"){ - msg = "We were not able to import this file. Please use a different document format or copy paste manually"; + msg = _("pad_impexp.convertFailed"); } else if(status === "uploadFailed"){ - msg = "The upload failed, please try again"; + msg = _("pad_impexp.uploadFailed"); } function showError(fade) { - $('#importmessagefail').html('Import failed: ' + (msg || 'Please copy paste'))[(fade ? "fadeIn" : "show")](); + $('#importmessagefail').html(''+_('pad_impexp.importfailed')+': ' + (msg || _('pad_impexp.copypaste','')))[(fade ? "fadeIn" : "show")](); } if ($('#importexport .importmessage').is(':visible')) @@ -198,7 +198,7 @@ var padimpexp = (function() { type = "this file"; } - alert("Exporting as " + type + " format is disabled. Please contact your" + " system administrator for details."); + alert(_("pad_impexp.exportdisabled", {type:type})); return false; } @@ -214,6 +214,9 @@ var padimpexp = (function() //get http://example.com/p/padname var pad_root_url = document.location.href.replace(document.location.pathname, pad_root_path) + //i10l buttom import + $('#importsubmitinput').val(_("pad_impexp.importbutton")); + // build the export links $("#exporthtmla").attr("href", pad_root_path + "/export/html"); $("#exportplaina").attr("href", pad_root_path + "/export/txt"); diff --git a/src/static/js/pad_savedrevs.js b/src/static/js/pad_savedrevs.js index bf4f941c..14fa1b6e 100644 --- a/src/static/js/pad_savedrevs.js +++ b/src/static/js/pad_savedrevs.js @@ -18,7 +18,7 @@ var pad; exports.saveNow = function(){ pad.collabClient.sendMessage({"type": "SAVE_REVISION"}); - alert("This revision is now marked as a saved revision"); + alert(_("pad_savedrevs.marked")); } exports.init = function(_pad){ diff --git a/src/static/js/pad_userlist.js b/src/static/js/pad_userlist.js index 474f9b0e..fe017912 100644 --- a/src/static/js/pad_userlist.js +++ b/src/static/js/pad_userlist.js @@ -113,12 +113,12 @@ var paduserlist = (function() nameHtml = padutils.escapeHtml(data.name); if (isGuest && pad.getIsProPad()) { - nameHtml += ' (Guest)'; + nameHtml += ' ('+_(pad_userlist.guest)+')'; } } else { - nameHtml = ''; + nameHtml = ''; } return ['
 
', '', nameHtml, '', '', padutils.escapeHtml(data.activity), ''].join(''); @@ -374,7 +374,7 @@ var paduserlist = (function() if (!newName) { jnode.addClass("editempty"); - jnode.val("unnamed"); + jnode.val(_('pad_userlist.unnamed')); } else { @@ -662,13 +662,13 @@ var paduserlist = (function() if (box.length == 0) { // make guest prompt box - box = $('
Guest: ' + padutils.escapeHtml(displayName) + '
'); + box = $('
'+_('pad_userlist.guest')+': ' + padutils.escapeHtml(displayName) + '
'); $("#guestprompts").append(box); } else { // update display name - box.find(".guestname").html('Guest: ' + padutils.escapeHtml(displayName)); + box.find(".guestname").html(''+_('pad_userlist.guest')+': ' + padutils.escapeHtml(displayName)); } var hideLater = padutils.getCancellableAction(actionName, function() { @@ -715,7 +715,7 @@ var paduserlist = (function() } else { - $("#myusernameedit").addClass("editempty").val("Enter your name"); + $("#myusernameedit").addClass("editempty").val(_("pad_userlist.entername")); } if (colorPickerOpen) { -- cgit v1.2.3