mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Fix html10n usage in code that wouldn't allow lang switching
This commit is contained in:
parent
580d936e50
commit
0c9178d392
3 changed files with 14 additions and 9 deletions
|
@ -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(_("pad.editbar.clearcolors")))
|
if (window.confirm(html10n.get("pad.editbar.clearcolors")))
|
||||||
{
|
{
|
||||||
ace.ace_performDocumentApplyAttributesToCharRange(0, ace.ace_getRep().alltext.length, [
|
ace.ace_performDocumentApplyAttributesToCharRange(0, ace.ace_getRep().alltext.length, [
|
||||||
['author', '']
|
['author', '']
|
||||||
|
|
|
@ -79,6 +79,7 @@ var padeditor = (function()
|
||||||
html10n.bind('localized', function() {
|
html10n.bind('localized', function() {
|
||||||
$("#languagemenu").val(html10n.getLanguage());
|
$("#languagemenu").val(html10n.getLanguage());
|
||||||
})
|
})
|
||||||
|
$("#languagemenu").val(html10n.getLanguage());
|
||||||
$("#languagemenu").change(function() {
|
$("#languagemenu").change(function() {
|
||||||
pad.createCookie("language",$("#languagemenu").val(),null,'/');
|
pad.createCookie("language",$("#languagemenu").val(),null,'/');
|
||||||
window.html10n.localize([$("#languagemenu").val(), 'en']);
|
window.html10n.localize([$("#languagemenu").val(), 'en']);
|
||||||
|
|
|
@ -69,7 +69,7 @@ var padimpexp = (function()
|
||||||
function fileInputSubmit()
|
function fileInputSubmit()
|
||||||
{
|
{
|
||||||
$('#importmessagefail').fadeOut("fast");
|
$('#importmessagefail').fadeOut("fast");
|
||||||
var ret = window.confirm(_("pad.impexp.confirmimport"));
|
var ret = window.confirm(html10n.get("pad.impexp.confirmimport"));
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
hidePanelCall = paddocbar.hideLaterIfNoOtherInteraction();
|
hidePanelCall = paddocbar.hideLaterIfNoOtherInteraction();
|
||||||
|
@ -85,7 +85,8 @@ var padimpexp = (function()
|
||||||
$('#importsubmitinput').attr(
|
$('#importsubmitinput').attr(
|
||||||
{
|
{
|
||||||
disabled: true
|
disabled: true
|
||||||
}).val(_("pad.impexp.importing"));
|
}).val(html10n.get("pad.impexp.importing"));
|
||||||
|
|
||||||
window.setTimeout(function()
|
window.setTimeout(function()
|
||||||
{
|
{
|
||||||
$('#importfileinput').attr(
|
$('#importfileinput').attr(
|
||||||
|
@ -106,7 +107,7 @@ var padimpexp = (function()
|
||||||
|
|
||||||
function importDone()
|
function importDone()
|
||||||
{
|
{
|
||||||
$('#importsubmitinput').removeAttr('disabled').val(_("pad.impexp.importbutton"));
|
$('#importsubmitinput').removeAttr('disabled').val(html10n.get("pad.impexp.importbutton"));
|
||||||
window.setTimeout(function()
|
window.setTimeout(function()
|
||||||
{
|
{
|
||||||
$('#importfileinput').removeAttr('disabled');
|
$('#importfileinput').removeAttr('disabled');
|
||||||
|
@ -130,14 +131,14 @@ var padimpexp = (function()
|
||||||
var msg="";
|
var msg="";
|
||||||
|
|
||||||
if(status === "convertFailed"){
|
if(status === "convertFailed"){
|
||||||
msg = _("pad.impexp.convertFailed");
|
msg = html10n.get("pad.impexp.convertFailed");
|
||||||
} else if(status === "uploadFailed"){
|
} else if(status === "uploadFailed"){
|
||||||
msg = _("pad.impexp.uploadFailed");
|
msg = html10n.get("pad.impexp.uploadFailed");
|
||||||
}
|
}
|
||||||
|
|
||||||
function showError(fade)
|
function showError(fade)
|
||||||
{
|
{
|
||||||
$('#importmessagefail').html('<strong style="color: red">'+_('pad.impexp.importfailed')+':</strong> ' + (msg || _('pad.impexp.copypaste','')))[(fade ? "fadeIn" : "show")]();
|
$('#importmessagefail').html('<strong style="color: red">'+html10n.get('pad.impexp.importfailed')+':</strong> ' + (msg || html10n.get('pad.impexp.copypaste','')))[(fade ? "fadeIn" : "show")]();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($('#importexport .importmessage').is(':visible'))
|
if ($('#importexport .importmessage').is(':visible'))
|
||||||
|
@ -198,7 +199,7 @@ var padimpexp = (function()
|
||||||
{
|
{
|
||||||
type = "this file";
|
type = "this file";
|
||||||
}
|
}
|
||||||
alert(_("pad.impexp.exportdisabled", {type:type}));
|
alert(html10n.get("pad.impexp.exportdisabled", {type:type}));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +216,10 @@ var padimpexp = (function()
|
||||||
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
|
//i10l buttom import
|
||||||
$('#importsubmitinput').val(_("pad.impexp.importbutton"));
|
$('#importsubmitinput').val(html10n.get("pad.impexp.importbutton"));
|
||||||
|
html10n.bind('localized', function() {
|
||||||
|
$('#importsubmitinput').val(html10n.get("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");
|
||||||
|
|
Loading…
Reference in a new issue