Merge pull request #1274 from joker-x/jstranslate

Add missing strings to be translatable
This commit is contained in:
Marcel Klehr 2012-12-09 12:53:10 -08:00
commit d1870e741f
9 changed files with 55 additions and 20 deletions

View file

@ -36,7 +36,7 @@ pad.settings.globalView = Global View
pad.settings.language = Language: pad.settings.language = Language:
pad.importExport.import_export = Import/Export pad.importExport.import_export = Import/Export
pad.importExport.import = Upload any text file or document pad.importExport.import = Upload any text file or document
pad.importExport.successful = Successful! pad.importExport.importSuccessful = Successful!
pad.importExport.export = Export current pad as: pad.importExport.export = Export current pad as:
pad.importExport.exporthtml = HTML pad.importExport.exporthtml = HTML
pad.importExport.exportplain = Plain text pad.importExport.exportplain = Plain text
@ -94,3 +94,19 @@ timeslider.month.september = September
timeslider.month.october = October timeslider.month.october = October
timeslider.month.november = November timeslider.month.november = November
timeslider.month.december = December timeslider.month.december = December
;js
pad.savedrevs.marked = This revision is now marked as a saved revision
pad.userlist.entername = Enter your name
pad.userlist.unnamed = unnamed
pad.userlist.guest = Guest
pad.userlist.deny = Deny
pad.userlist.approve = Approve
pad.editbar.clearcolors = Clear authorship colors on entire document?
pad.impexp.importbutton = Import Now
pad.impexp.importing = Importing...
pad.impexp.confirmimport = Importing a file will overwrite the current text of the pad. Are you sure you want to proceed?
pad.impexp.convertFailed = We were not able to import this file. Please use a different document format or copy paste manually
pad.impexp.uploadFailed = The upload failed, please try again
pad.impexp.importfailed = Import failed
pad.impexp.copypaste = Please copy paste
pad.impexp.exportdisabled = Exporting as {{type}} format is disabled. Please contact your system administrator for details.

View file

@ -95,3 +95,19 @@ timeslider.month.september = Septiembre
timeslider.month.october = Octubre timeslider.month.october = Octubre
timeslider.month.november = Noviembre timeslider.month.november = Noviembre
timeslider.month.december = Diciembre timeslider.month.december = Diciembre
;js
pad.savedrevs.marked = Revisión guardada
pad.userlist.entername = Escribe tu nombre
pad.userlist.unnamed = anónimo
pad.userlist.guest = Invitado
pad.userlist.deny = Denegar
pad.userlist.approve = Aprobar
pad.editbar.clearcolors = ¿Desea borrar el color de los autores en todo el documento?
pad.impexp.importbutton = Importar
pad.impexp.importing = Importando...
pad.impexp.confirmimport = Al importar un fichero se borrará el contenido actual del documento. ¿Quiere continuar?
pad.impexp.convertFailed = No pudimos importar este fichero. Intentalo con otro formato diferente o copia y pega manualmente.
pad.impexp.uploadFailed = El envío del fichero falló. Intentelo de nuevo.
pad.impexp.importfailed = Fallo al importar
pad.impexp.copypaste = Intente copiar y pegar
pad.impexp.exportdisabled = La exportación al formato {{type}} format está desactivada. Contacte con su administrador de sistemas.

View file

@ -109,7 +109,7 @@ var chat = (function()
} }
/* End of new action */ /* 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 = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>"; var html = "<p class='" + authorClass + "'><b>" + authorName + ":</b><span class='time " + authorClass + "'>" + timeStr + "</span> " + text + "</p>";
$("#chattext").append(html); $("#chattext").append(html);

View file

@ -169,7 +169,7 @@ var padeditbar = (function()
{ {
if ((!(ace.ace_getRep().selStart && ace.ace_getRep().selEnd)) || ace.ace_isCaret()) 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, [ ace.ace_performDocumentApplyAttributesToCharRange(0, ace.ace_getRep().alltext.length, [
['author', ''] ['author', '']

View file

@ -69,7 +69,7 @@ var padimpexp = (function()
function fileInputSubmit() function fileInputSubmit()
{ {
$('#importmessagefail').fadeOut("fast"); $('#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) if (ret)
{ {
hidePanelCall = paddocbar.hideLaterIfNoOtherInteraction(); hidePanelCall = paddocbar.hideLaterIfNoOtherInteraction();
@ -85,7 +85,7 @@ var padimpexp = (function()
$('#importsubmitinput').attr( $('#importsubmitinput').attr(
{ {
disabled: true disabled: true
}).val("Importing..."); }).val(_("pad.impexp.importing"));
window.setTimeout(function() window.setTimeout(function()
{ {
$('#importfileinput').attr( $('#importfileinput').attr(
@ -106,7 +106,7 @@ var padimpexp = (function()
function importDone() function importDone()
{ {
$('#importsubmitinput').removeAttr('disabled').val("Import Now"); $('#importsubmitinput').removeAttr('disabled').val(_("pad.impexp.importbutton"));
window.setTimeout(function() window.setTimeout(function()
{ {
$('#importfileinput').removeAttr('disabled'); $('#importfileinput').removeAttr('disabled');
@ -130,14 +130,14 @@ var padimpexp = (function()
var msg=""; var msg="";
if(status === "convertFailed"){ 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"){ } else if(status === "uploadFailed"){
msg = "The upload failed, please try again"; msg = _("pad.impexp.uploadFailed");
} }
function showError(fade) function showError(fade)
{ {
$('#importmessagefail').html('<strong style="color: red">Import failed:</strong> ' + (msg || 'Please copy paste'))[(fade ? "fadeIn" : "show")](); $('#importmessagefail').html('<strong style="color: red">'+_('pad.impexp.importfailed')+':</strong> ' + (msg || _('pad.impexp.copypaste','')))[(fade ? "fadeIn" : "show")]();
} }
if ($('#importexport .importmessage').is(':visible')) if ($('#importexport .importmessage').is(':visible'))
@ -198,7 +198,7 @@ var padimpexp = (function()
{ {
type = "this file"; 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; return false;
} }
@ -214,6 +214,9 @@ var padimpexp = (function()
//get http://example.com/p/padname //get http://example.com/p/padname
var pad_root_url = document.location.href.replace(document.location.pathname, pad_root_path) 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 // build the export links
$("#exporthtmla").attr("href", pad_root_path + "/export/html"); $("#exporthtmla").attr("href", pad_root_path + "/export/html");
$("#exportplaina").attr("href", pad_root_path + "/export/txt"); $("#exportplaina").attr("href", pad_root_path + "/export/txt");

View file

@ -18,7 +18,7 @@ var pad;
exports.saveNow = function(){ exports.saveNow = function(){
pad.collabClient.sendMessage({"type": "SAVE_REVISION"}); pad.collabClient.sendMessage({"type": "SAVE_REVISION"});
alert("This revision is now marked as a saved revision"); alert(_("pad.savedrevs.marked"));
} }
exports.init = function(_pad){ exports.init = function(_pad){

View file

@ -113,12 +113,12 @@ var paduserlist = (function()
nameHtml = padutils.escapeHtml(data.name); nameHtml = padutils.escapeHtml(data.name);
if (isGuest && pad.getIsProPad()) if (isGuest && pad.getIsProPad())
{ {
nameHtml += ' (Guest)'; nameHtml += ' ('+_(pad.userlist.guest)+')';
} }
} }
else else
{ {
nameHtml = '<input type="text" class="editempty newinput" value="unnamed" ' + (isNameEditable(data) ? '' : 'disabled="disabled" ') + '/>'; nameHtml = '<input type="text" class="editempty newinput" value="'+_('pad.userlist.unnamed')+'" ' + (isNameEditable(data) ? '' : 'disabled="disabled" ') + '/>';
} }
return ['<td style="height:', height, 'px" class="usertdswatch"><div class="swatch" style="background:' + data.color + '">&nbsp;</div></td>', '<td style="height:', height, 'px" class="usertdname">', nameHtml, '</td>', '<td style="height:', height, 'px" class="activity">', padutils.escapeHtml(data.activity), '</td>'].join(''); return ['<td style="height:', height, 'px" class="usertdswatch"><div class="swatch" style="background:' + data.color + '">&nbsp;</div></td>', '<td style="height:', height, 'px" class="usertdname">', nameHtml, '</td>', '<td style="height:', height, 'px" class="activity">', padutils.escapeHtml(data.activity), '</td>'].join('');
@ -374,7 +374,7 @@ var paduserlist = (function()
if (!newName) if (!newName)
{ {
jnode.addClass("editempty"); jnode.addClass("editempty");
jnode.val("unnamed"); jnode.val(_('pad.userlist.unnamed'));
} }
else else
{ {
@ -662,13 +662,13 @@ var paduserlist = (function()
if (box.length == 0) if (box.length == 0)
{ {
// make guest prompt box // make guest prompt box
box = $('<div id="'+padutils.escapeHtml('guestprompt-' + encodedUserId) + '" class="guestprompt"><div class="choices"><a href="' + padutils.escapeHtml('javascript:void(require('+JSON.stringify(module.id)+').paduserlist.answerGuestPrompt(' + JSON.stringify(encodedUserId) + ',false))')+'">Deny</a> <a href="' + padutils.escapeHtml('javascript:void(require('+JSON.stringify(module.id)+').paduserlist.answerGuestPrompt(' + JSON.stringify(encodedUserId) + ',true))') + '">Approve</a></div><div class="guestname"><strong>Guest:</strong> ' + padutils.escapeHtml(displayName) + '</div></div>'); box = $('<div id="'+padutils.escapeHtml('guestprompt-' + encodedUserId) + '" class="guestprompt"><div class="choices"><a href="' + padutils.escapeHtml('javascript:void(require('+JSON.stringify(module.id)+').paduserlist.answerGuestPrompt(' + JSON.stringify(encodedUserId) + ',false))')+'">'+_('pad.userlist.deny')+'</a> <a href="' + padutils.escapeHtml('javascript:void(require('+JSON.stringify(module.id)+').paduserlist.answerGuestPrompt(' + JSON.stringify(encodedUserId) + ',true))') + '">'+_('pad.userlist.approve')+'</a></div><div class="guestname"><strong>'+_('pad.userlist.guest')+':</strong> ' + padutils.escapeHtml(displayName) + '</div></div>');
$("#guestprompts").append(box); $("#guestprompts").append(box);
} }
else else
{ {
// update display name // update display name
box.find(".guestname").html('<strong>Guest:</strong> ' + padutils.escapeHtml(displayName)); box.find(".guestname").html('<strong>'+_('pad.userlist.guest')+':</strong> ' + padutils.escapeHtml(displayName));
} }
var hideLater = padutils.getCancellableAction(actionName, function() var hideLater = padutils.getCancellableAction(actionName, function()
{ {
@ -715,7 +715,7 @@ var paduserlist = (function()
} }
else else
{ {
$("#myusernameedit").addClass("editempty").val("Enter your name"); $("#myusernameedit").addClass("editempty").val(_("pad.userlist.entername"));
} }
if (colorPickerOpen) if (colorPickerOpen)
{ {

View file

@ -42,7 +42,7 @@
if(language) document.documentElement.lang = language[1]; if(language) document.documentElement.lang = language[1];
})(); })();
</script> </script>
<script type="text/javascript" src="../static/js/l10n.js" async></script> <script type="text/javascript" src="../static/js/l10n.js"></script>
<% e.begin_block("styles"); %> <% e.begin_block("styles"); %>
<link href="../static/css/pad.css" rel="stylesheet"> <link href="../static/css/pad.css" rel="stylesheet">
@ -266,7 +266,7 @@
<div class="importmessage" id="importmessagefail"></div> <div class="importmessage" id="importmessagefail"></div>
</div> </div>
<div id="import"></div> <div id="import"></div>
<div class="importmessage" id="importmessagesuccess" data-l10n-id="pad.importExport.successful"></div> <div class="importmessage" id="importmessagesuccess" data-l10n-id="pad.importExport.importSuccessful"></div>
<div class="importformdiv" id="importformsubmitdiv"> <div class="importformdiv" id="importformsubmitdiv">
<input type="hidden" name="padId" value="blpmaXT35R"> <input type="hidden" name="padId" value="blpmaXT35R">
<span class="nowrap"> <span class="nowrap">

View file

@ -41,7 +41,7 @@
if(language) document.documentElement.lang = language[1]; if(language) document.documentElement.lang = language[1];
})(); })();
</script> </script>
<script type="text/javascript" src="../../static/js/l10n.js" async></script> <script type="text/javascript" src="../../static/js/l10n.js"></script>
<link rel="stylesheet" href="../../static/css/pad.css"> <link rel="stylesheet" href="../../static/css/pad.css">
<link rel="stylesheet" href="../../static/css/timeslider.css"> <link rel="stylesheet" href="../../static/css/timeslider.css">
<link rel="stylesheet" href="../../static/custom/timeslider.css"> <link rel="stylesheet" href="../../static/custom/timeslider.css">