summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2012-12-20 11:19:51 +0100
committerMarcel Klehr <mklehr@gmx.net>2012-12-23 18:17:19 +0100
commit0c9178d392970012b6c9f87fc8b88fada7eeaab5 (patch)
treef4c0edf25bde55b0d99f504092d93b2b1aea2f1a /src
parent580d936e50e2b898cb4dd48ce95716b0014ff3df (diff)
downloadetherpad-lite-0c9178d392970012b6c9f87fc8b88fada7eeaab5.zip
Fix html10n usage in code that wouldn't allow lang switching
Diffstat (limited to 'src')
-rw-r--r--src/static/js/pad_editbar.js2
-rw-r--r--src/static/js/pad_editor.js1
-rw-r--r--src/static/js/pad_impexp.js20
3 files changed, 14 insertions, 9 deletions
diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js
index 6a7f6ee1..91a07bf9 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(_("pad.editbar.clearcolors")))
+ if (window.confirm(html10n.get("pad.editbar.clearcolors")))
{
ace.ace_performDocumentApplyAttributesToCharRange(0, ace.ace_getRep().alltext.length, [
['author', '']
diff --git a/src/static/js/pad_editor.js b/src/static/js/pad_editor.js
index 1aca7460..f4778802 100644
--- a/src/static/js/pad_editor.js
+++ b/src/static/js/pad_editor.js
@@ -79,6 +79,7 @@ var padeditor = (function()
html10n.bind('localized', function() {
$("#languagemenu").val(html10n.getLanguage());
})
+ $("#languagemenu").val(html10n.getLanguage());
$("#languagemenu").change(function() {
pad.createCookie("language",$("#languagemenu").val(),null,'/');
window.html10n.localize([$("#languagemenu").val(), 'en']);
diff --git a/src/static/js/pad_impexp.js b/src/static/js/pad_impexp.js
index 0199b346..c7a26fbe 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(_("pad.impexp.confirmimport"));
+ var ret = window.confirm(html10n.get("pad.impexp.confirmimport"));
if (ret)
{
hidePanelCall = paddocbar.hideLaterIfNoOtherInteraction();
@@ -85,7 +85,8 @@ var padimpexp = (function()
$('#importsubmitinput').attr(
{
disabled: true
- }).val(_("pad.impexp.importing"));
+ }).val(html10n.get("pad.impexp.importing"));
+
window.setTimeout(function()
{
$('#importfileinput').attr(
@@ -106,7 +107,7 @@ var padimpexp = (function()
function importDone()
{
- $('#importsubmitinput').removeAttr('disabled').val(_("pad.impexp.importbutton"));
+ $('#importsubmitinput').removeAttr('disabled').val(html10n.get("pad.impexp.importbutton"));
window.setTimeout(function()
{
$('#importfileinput').removeAttr('disabled');
@@ -130,14 +131,14 @@ var padimpexp = (function()
var msg="";
if(status === "convertFailed"){
- msg = _("pad.impexp.convertFailed");
+ msg = html10n.get("pad.impexp.convertFailed");
} else if(status === "uploadFailed"){
- msg = _("pad.impexp.uploadFailed");
+ msg = html10n.get("pad.impexp.uploadFailed");
}
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'))
@@ -198,7 +199,7 @@ var padimpexp = (function()
{
type = "this file";
}
- alert(_("pad.impexp.exportdisabled", {type:type}));
+ alert(html10n.get("pad.impexp.exportdisabled", {type:type}));
return false;
}
@@ -215,7 +216,10 @@ var padimpexp = (function()
var pad_root_url = document.location.href.replace(document.location.pathname, pad_root_path)
//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
$("#exporthtmla").attr("href", pad_root_path + "/export/html");