Author: chregu
Date: Fri Jul 29 11:32:48 2005
New Revision: 1360
Added:
branches/bxe_2_0/lang/fr.xml
Modified:
branches/bxe_2_0/js/bxeFunctions.js
branches/bxe_2_0/js/bxeXMLDocument.js
branches/bxe_2_0/js/i18n.js
branches/bxe_2_0/js/table.js
branches/bxe_2_0/js/widget.js
Log:
- added a lot of i18n.getText options (by Ludovic Gasc)
- added french lang file
Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js (original)
+++ branches/bxe_2_0/js/bxeFunctions.js Fri Jul 29 11:32:48 2005
@@ -33,7 +33,7 @@
const BXE_SNAPSHOT_LENGTH = 20;
function __bxeSave(e) {
if (bxe_bug248172_check()) {
- alert ("THIS DOCUMENT COULD NOT BE SAVED!\n You are using a Mozilla release with a broken XMLSerializer implementation.\n Mozilla 1.7 and Firefox 0.9/0.9.1 are known to have this bug.\n Please up- or downgrade.");
+ alert (bxe_i18n.getText("THIS DOCUMENT COULD NOT BE SAVED!\n You are using a Mozilla release with a broken XMLSerializer implementation.\n Mozilla 1.7 and Firefox 0.9/0.9.1 are known to have this bug.\n Please up- or downgrade."));
return false;
}
@@ -46,7 +46,7 @@
}
var xml = bxe_getXmlDomDocument(true);
if (!xml) {
- alert("You're in Source Mode. Not possible to use this button");
+ alert(bxe_i18n.getText("You're in Source Mode. Not possible to use this button"));
}
var xmlstr =xml.saveXML(xml);
@@ -55,14 +55,14 @@
if (e.isError) {
- var widg = mozilla.getWidgetModalBox("Saving");
- widg.addText("Document couldn't be saved");
+ var widg = mozilla.getWidgetModalBox(bxe_i18n.getText("Saving"));
+ widg.addText(bxe_i18n.getText("Document couldn't be saved"));
widg.addText(e.statusText,true);
widg.show((window.innerWidth- 500)/2,50, "fixed");
return;
}
bxe_lastSavedXML = bxe_getXmlDocument();
- bxe_status_bar.showMessage("Document successfully saved");
+ bxe_status_bar.showMessage(bxe_i18n.getText("Document successfully saved"));
if (e.status == 201 && bxe_config.options['onSaveFileCreated']) {
eval(bxe_config.options['onSaveFileCreated']);
@@ -101,10 +101,10 @@
var end = new Date();
- debug ("Benchmark " + string);
+ debug (bxe_i18n.getText("Benchmark ") + string);
// debug ("Start " + start.getTime());
// debug ("End " + end.getTime() );
- debug ("Total " +(end-start) + " / " + iter + " = " + (end-start)/iter);
+ debug (bxe_i18n.getText("Total ") +(end-start) + " / " + iter + " = " + (end-start)/iter);
}
function bxe_bench() {
@@ -142,7 +142,7 @@
function bxe_history_redo() {
if (bxe_snapshots_position >= 0 && bxe_snapshots[( bxe_snapshots_position + 1)]) {
var currXmlStr = bxe_getXmlDocument();
- if (!currXmlStr) { alert("You're in Source Mode. Not possible to use this button"); return false;}
+ if (!currXmlStr) { alert(bxe_i18n.getText("You're in Source Mode. Not possible to use this button")); return false;}
bxe_snapshots_position++;
var xmlstr = bxe_snapshots[bxe_snapshots_position];
if (currXmlStr == xmlstr && bxe_snapshots[bxe_snapshots_position + 1]) {
@@ -169,7 +169,7 @@
var currXmlStr = bxe_getXmlDocument();
}
- if (!currXmlStr) { alert("You're in Source Mode. Not possible to use this button"); return false;}
+ if (!currXmlStr) { alert(bxe_i18n.getText("You're in Source Mode. Not possible to use this button")); return false;}
var xmlstr = bxe_snapshots[bxe_snapshots_position];
if (xmlstr) {
bxe_snapshots_position--;
@@ -473,7 +473,7 @@
e.additionalInfo.namespaceURI = "";
}
if (bxe_checkForSourceMode(sel)) {
- alert("You're in Source Mode. Not possible to use this button");
+ alert(bxe_i18n.getText("You're in Source Mode. Not possible to use this button"));
return false;
}
//search, if we are already in this mode for anchorNode
@@ -646,7 +646,7 @@
if (node.vdom && node.vdom.hasAttributes ) {
- var menui = popup.addMenuItem("Edit " + node.vdom.bxeName + " Attributes", mozilla.getWidgetGlobals().EditAttributes.popup);
+ var menui = popup.addMenuItem(bxe_i18n.getText("Edit {0} Attributes",new Array(node.vdom.bxeName)), mozilla.getWidgetGlobals().EditAttributes.popup);
menui.MenuPopup._node = node._node;
}
@@ -671,7 +671,7 @@
if (node.parentNode.isAllowedChild(_clipboardNamespaceUri, _clipboardNodeName)) {
- popup.addMenuItem("Append " + _clipboardNodeName + " from Clipboard", function (e) {
+ popup.addMenuItem(bxe_i18n.getText("Append {0} from Clipboard",new Array(_clipboardNodeName)), function (e) {
var widget = e.currentTarget.Widget;
var appNode = widget.MenuPopup.MainNode;
var clip = mozilla.getClipboard();
@@ -682,7 +682,7 @@
}
}
- popup.addMenuItem("Delete " + node.vdom.bxeName + " Element", function (e) {
+ popup.addMenuItem(bxe_i18n.getText("Delete {0} Element",new Array(node.vdom.bxeName)), function (e) {
var widget = e.currentTarget.Widget;
var delNode = widget.MenuPopup.MainNode;
//delNode.unlink();
@@ -691,10 +691,10 @@
var par = delNode.parentNode
delNode.unlink();
bxe_Transform(false,false,par);
- },"Deletes the Element and all its children");
+ },bxe_i18n.getText("Deletes the Element and all its children"));
if (node.parentNode.canHaveText) {
- popup.addMenuItem("Clean ", function (e) {
+ popup.addMenuItem(bxe_i18n.getText("Clean "), function (e) {
var widget = e.currentTarget.Widget;
var delNode = widget.MenuPopup.MainNode;
@@ -703,11 +703,11 @@
var par = delNode.parentNode;
delNode._node.removeElementOnly();
bxe_Transform(false,false,par);
- }, "Removes the Element, but not its children");
+ }, bxe_i18n.getText("Removes the Element, but not its children"));
}
if (node.previousSibling) {
- popup.addMenuItem("Move up", function (e) {
+ popup.addMenuItem(bxe_i18n.getText("Move up"), function (e) {
var widget = e.currentTarget.Widget;
var appNode = widget.MenuPopup.MainNode;
var prevSibling = appNode.previousSibling;
@@ -725,7 +725,7 @@
}
if (node.nextSibling) {
- popup.addMenuItem("Move down", function (e) {
+ popup.addMenuItem(bxe_i18n.getText("Move down"), function (e) {
var widget = e.currentTarget.Widget;
var appNode = widget.MenuPopup.MainNode;
var nextSibling = appNode.nextSibling;
@@ -775,7 +775,7 @@
//split
if (node._node.getAttribute("colspan") > 1) {
- var menui = popup.addMenuItem("Split right", function(e) {
+ var menui = popup.addMenuItem(bxe_i18n.getText("Split right"), function(e) {
var widget = e.currentTarget.Widget;
var _par = widget.MenuPopup.MainNode._node.parentNode;
widget.MenuPopup.MainNode._node.TableCellSplitRight();
@@ -786,7 +786,7 @@
if (node._node.getAttribute("rowspan") > 1) {
- var menui = popup.addMenuItem("Split down", function(e) {
+ var menui = popup.addMenuItem(bxe_i18n.getText("Split down"), function(e) {
var widget = e.currentTarget.Widget;
var _par = widget.MenuPopup.MainNode._node.parentNode;
widget.MenuPopup.MainNode._node.TableCellSplitDown();
@@ -802,7 +802,7 @@
nextSibling = nextSibling.nextSibling;
}
if (nextSibling && (nextSibling.localName == "td" || nextSibling.localName == "th")) {
- var menui = popup.addMenuItem("Merge right", function(e) {
+ var menui = popup.addMenuItem(bxe_i18n.getText("Merge right"), function(e) {
var widget = e.currentTarget.Widget;
var _par = widget.MenuPopup.MainNode._node.parentNode;
widget.MenuPopup.MainNode._node.TableCellMergeRight();
@@ -833,7 +833,7 @@
});
}
}*/
- var menui = popup.addMenuItem("Merge down", function(e) {
+ var menui = popup.addMenuItem(bxe_i18n.getText("Merge down"), function(e) {
var widget = e.currentTarget.Widget;
var _par = widget.MenuPopup.MainNode._node.parentNode;
widget.MenuPopup.MainNode._node.TableCellMergeDown();
@@ -841,21 +841,21 @@
//_par.updateXMLNode();
});
- var menui = popup.addMenuItem("Append Row", function(e) {
+ var menui = popup.addMenuItem(bxe_i18n.getText("Append Row"), function(e) {
var widget = e.currentTarget.Widget;
widget.MenuPopup.MainNode._node.TableAppendRow();
bxe_Transform(false,false,widget.MenuPopup.MainNode.parentNode);
});
- var menui = popup.addMenuItem("Append Col", function(e) {
+ var menui = popup.addMenuItem(bxe_i18n.getText("Append Col"), function(e) {
var widget = e.currentTarget.Widget;
var _par = widget.MenuPopup.MainNode._node.parentNode.parentNode;
widget.MenuPopup.MainNode._node.TableAppendCol();
bxe_Transform(true,false,widget.MenuPopup.MainNode.parentNode);
});
- var menui = popup.addMenuItem("Remove Row", function(e) {
+ var menui = popup.addMenuItem(bxe_i18n.getText("Remove Row"), function(e) {
var widget = e.currentTarget.Widget;
var _par = widget.MenuPopup.MainNode._node.parentNode.parentNode;
widget.MenuPopup.MainNode._node.TableRemoveRow();
@@ -863,7 +863,7 @@
});
- var menui = popup.addMenuItem("Remove Col", function(e) {
+ var menui = popup.addMenuItem(bxe_i18n.getText("Remove Col"), function(e) {
var widget = e.currentTarget.Widget;
var _par = widget.MenuPopup.MainNode._node.parentNode.parentNode;
widget.MenuPopup.MainNode._node.TableRemoveCol();
@@ -1155,58 +1155,58 @@
img.setAttribute("align","right");
bxe_menubar.node.appendChild(img);
- var submenu = new Array("Save",function() {eDOMEventCall("DocumentSave",document);});
- submenu.push("Save & Exit",function() {eDOMEventCall("DocumentSave",document,{"exit": true});});
- submenu.push("Exit",function() {eDOMEventCall("Exit",document);});
- bxe_menubar.addMenu("File",submenu);
+ var submenu = new Array(bxe_i18n.getText("Save"),function() {eDOMEventCall("DocumentSave",document);});
+ submenu.push(bxe_i18n.getText("Save & Exit"),function() {eDOMEventCall("DocumentSave",document,{"exit": true});});
+ submenu.push(bxe_i18n.getText("Exit"),function() {eDOMEventCall("Exit",document);});
+ bxe_menubar.addMenu(bxe_i18n.getText("File"),submenu);
- var submenu2 = new Array("Undo",function() {eDOMEventCall("Undo",document);},"Redo",function () {eDOMEventCall("Redo",document)});
- bxe_menubar.addMenu("Edit",submenu2);
+ var submenu2 = new Array(bxe_i18n.getText("Undo"),function() {eDOMEventCall("Undo",document);},bxe_i18n.getText("Redo"),function () {eDOMEventCall("Redo",document)});
+ bxe_menubar.addMenu(bxe_i18n.getText("Edit"),submenu2);
var submenu3 = new Array();
- submenu3.push("Show XML Document",function(e) {BX_showInWindow(bxe_getXmlDocument(true));})
- submenu3.push("Show RNG Document",function(e) {BX_showInWindow(bxe_getRelaxNGDocument());})
+ submenu3.push(bxe_i18n.getText("Show XML Document"),function(e) {BX_showInWindow(bxe_getXmlDocument(true));})
+ submenu3.push(bxe_i18n.getText("Show RNG Document"),function(e) {BX_showInWindow(bxe_getRelaxNGDocument());})
- bxe_menubar.addMenu("Debug",submenu3);
+ bxe_menubar.addMenu(bxe_i18n.getText("Debug"),submenu3);
var submenu4 = new Array();
- submenu4.push("About Bitflux Editor",function(e) {
+ submenu4.push(bxe_i18n.getText("About Bitflux Editor"),function(e) {
bxe_about_box.setText("");
bxe_about_box.show(true);
});
- submenu4.push("Help",function (e) {
+ submenu4.push(bxe_i18n.getText("Help"),function (e) {
bla = window.open("http://wiki.bitfluxeditor.org/BXE_2.0","help","width=800,height=600,left=0,top=0");
bla.focus();
});
- submenu4.push("BXE Website",function (e) {
+ submenu4.push(bxe_i18n.getText("BXE Website"),function (e) {
bla = window.open("http://www.bitfluxeditor.org","help","width=800,height=600,left=0,top=0");
bla.focus();
});
- submenu4.push("Show System Info", function(e) {
+ submenu4.push(bxe_i18n.getText("Show System Info"), function(e) {
var modal = new Widget_ModalBox();
modal.node = modal.initNode("div","ModalBox");
modal.Display = "block";
modal.node.appendToBody();
modal.position(100,100,"absolute");
- modal.initTitle("System Info");
+ modal.initTitle(bxe_i18n.getText("System Info"));
modal.initPane();
- var innerhtml = "<br/>BXE Version: " + BXE_VERSION + "<br />";
- innerhtml += "BXE Build Date: " + BXE_BUILD + "<br/>";
- innerhtml += "BXE Revision: " + BXE_REVISION + "<br/><br/>";
- innerhtml += "User Agent: " + navigator.userAgent + "<br/><br/>";
+ var innerhtml = "<br/>" + bxe_i18n.getText("BXE Version: ") + BXE_VERSION + "<br />";
+ innerhtml += bxe_i18n.getText("BXE Build Date: ") + BXE_BUILD + "<br/>";
+ innerhtml += bxe_i18n.getText("BXE Revision: ") + BXE_REVISION + "<br/><br/>";
+ innerhtml += bxe_i18n.getText("User Agent: ") + navigator.userAgent + "<br/><br/>";
modal.PaneNode.innerHTML = innerhtml;
modal.draw();
var subm = document.createElement("input");
subm.setAttribute("type","submit");
- subm.setAttribute("value","OK");
+ subm.setAttribute("value",bxe_i18n.getText("OK"));
subm.onclick = function(e) {
var Widget = e.target.parentNode.parentNode.Widget;
e.target.parentNode.parentNode.style.display = "none";
@@ -1215,14 +1215,14 @@
});
- submenu4.push("Report Bug",function(e) {
+ submenu4.push(bxe_i18n.getText("Report Bug"),function(e) {
bla = window.open("http://bugs.bitfluxeditor.org/enter_bug.cgi?product=Editor&version="+BXE_VERSION+"&priority=P3&bug_severity=normal&bug_status=NEW&assigned_to=&cc=&bug_file_loc=http%3A%2F%2F&short_desc=&comment=***%0DVersion: "+BXE_VERSION + "%0DBuild: " + BXE_BUILD +"%0DUser Agent: "+navigator.userAgent + "%0D***&maketemplate=Remember+values+as+bookmarkable+template&form_name=enter_bug","help","");
bla.focus();
});
- bxe_menubar.addMenu("Help",submenu4);
+ bxe_menubar.addMenu(bxe_i18n.getText("Help"),submenu4);
bxe_menubar.draw();
@@ -1292,7 +1292,7 @@
if (block ) {
var thisNode = block;
if (!thisNode) {
- bxe_format_list.appendItem("no block found","");
+ bxe_format_list.appendItem(bxe_i18n.getText("no block found"),"");
return false;
}
@@ -1313,7 +1313,7 @@
} else {
- bxe_format_list.appendItem("no block found","");
+ bxe_format_list.appendItem(bxe_i18n.getText("no block found"),"");
}
}
}
@@ -1461,7 +1461,7 @@
return false;
}
- var mod = mozilla.getWidgetModalBox("Enter the image url or file name:", function(values) {
+ var mod = mozilla.getWidgetModalBox(bxe_i18n.getText("Enter the image url or file name:"), function(values) {
if(values.imgref == null) // null href means prompt canceled
return;
if(values.imgref == "")
@@ -1475,7 +1475,7 @@
img.setAttribute("src",values.imgref);
});
- mod.addItem("imgref", "", "textfield","Image URL:");
+ mod.addItem("imgref", "", "textfield",bxe_i18n.getText("Image URL:"));
mod.show(100,50,"fixed");
}
@@ -1483,14 +1483,14 @@
function bxe_checkForSourceMode(sel) {
if (bxe_format_list.node.options.length == 1 && bxe_format_list.node.options.selectedIndex == 0) {
if ( bxe_format_list.node.options[0].text == "-Source Mode-") {
- alert("You're in Source Mode. Not possible to use this button");
+ alert(bxe_i18n.getText("You're in Source Mode. Not possible to use this button"));
return true;
}
}
// the following is legacy code. actually not needed anymore, AFAIK..
var cssr = sel.getEditableRange();
if (cssr && cssr.top._SourceMode) {
- alert("You're in Source Mode. Not possible to use this button");
+ alert(bxe_i18n.getText("You're in Source Mode. Not possible to use this button"));
return true;
}
return false;
@@ -1520,7 +1520,7 @@
return true;
} else {
if (!noAlert) {
- alert (localName + " is not allowed as child of " + node.XMLNode.localName);
+ alert (bxe_i18n.getText("{0} is not allowed as child of {1}",new Array(localName,node.XMLNode.localName)));
}
return false;
}
@@ -1531,7 +1531,7 @@
var cssr = sel.getEditableRange();
if (!bxe_checkIsAllowedChild("","table",sel, true) && !bxe_checkIsAllowedChildOfNode("","table",cssr.startContainer.parentNode.parentNode, true)) {
- alert ("Table is not allowed here");
+ alert (bxe_i18n.getText("Table is not allowed here"));
return false;
}
@@ -1550,10 +1550,10 @@
return false;
}
- var mod = mozilla.getWidgetModalBox("Create Table", function(values) {
+ var mod = mozilla.getWidgetModalBox(bxe_i18n.getText("Create Table"), function(values) {
var te = documentCreateTable(values["rows"], values["cols"]);
if(!te) {
- alert("Can't create table: invalid data");
+ alert(bxe_i18n.getText("Can't create table: invalid data"));
}
else if (window.bxe_ContextNode == BXE_SELECTION) {
//te.setAttribute("class", bxe_config.options[OPTION_DEFAULTTABLECLASS]);
@@ -1576,8 +1576,8 @@
bxe_Transform();
}
});
- mod.addItem("rows",2,"textfield","number of rows");
- mod.addItem("cols",2,"textfield","number of cols");
+ mod.addItem("rows",2,"textfield",bxe_i18n.getText("number of rows"));
+ mod.addItem("cols",2,"textfield",bxe_i18n.getText("number of cols"));
mod.show(100,50, "fixed");
}
@@ -1705,7 +1705,7 @@
}
- var mod = mozilla.getWidgetModalBox("Enter a URL:", function(values) {
+ var mod = mozilla.getWidgetModalBox(bxe_i18n.getText("Enter a URL:"), function(values) {
var href = values["href"];
if(href == null) // null href means prompt canceled - BUG FIX FROM Karl Guertin
return;
@@ -1724,7 +1724,7 @@
);
- mod.addItem("href",aValue,"textfield","Enter a URL:");
+ mod.addItem("href",aValue,"textfield",bxe_i18n.getText("Enter a URL:"));
mod.show(100,50, "fixed");
@@ -1744,34 +1744,34 @@
}
function bxe_catch_alert_message(e) {
- var mes = "ERROR in Bitflux Editor:\n"+e.message +"\n";
+ var mes = bxe_i18n.getText("ERROR in Bitflux Editor:") + "\n" + e.message +"\n";
try
{
if (e.filename) {
- mes += "In File: " + e.filename +"\n";
+ mes += bxe_i18n.getText("In File: ") + e.filename +"\n";
} else {
- mes += "In File: " + e.fileName +"\n";
+ mes += bxe_i18n.getText("In File: ") + e.fileName +"\n";
}
}
catch (e)
{
- mes += "In File: " + e.fileName +"\n";
+ mes += bxe_i18n.getText("In File: ") + e.fileName +"\n";
}
try
{
- mes += "Linenumber: " + e.lineNumber + "\n";
+ mes += bxe_i18n.getText("Linenumber: ") + e.lineNumber + "\n";
}
catch(e) {}
- mes += "Type: " + e.name + "\n";
- mes += "Stack:" + e.stack + "\n";
+ mes += bxe_i18n.getText("Type: ") + e.name + "\n";
+ mes += bxe_i18n.getText("Stack:") + e.stack + "\n";
return mes;
}
function bxe_exit(e) {
if (bxe_checkChangedDocument()) {
- if (confirm( "You have unsaved changes.\n Click cancel to return to the document.\n Click OK to really leave to page.")) {
+ if (confirm(bxe_i18n.getText("You have unsaved changes.\n Click cancel to return to the document.\n Click OK to really leave to page."))) {
bxe_lastSavedXML = bxe_getXmlDocument();
window.location = bxe_config.exitdestination;
}
@@ -1792,7 +1792,7 @@
}
function bxe_not_yet_implemented() {
- alert("not yet implemented");
+ alert(bxe_i18n.getText("not yet implemented"));
}
@@ -2054,20 +2054,20 @@
function bxe_checkIfNotALink (node) {
var sel = window.getSelection();
if (sel.anchorNode.parentNode.XMLNode.localName == "a" || sel.focusNode.parentNode.XMLNode.localName == "a") {
- alert("There is already a link here, please use the \"Edit Attributes\" function, to edit the link.");
+ alert(bxe_i18n.getText("There is already a link here, please use the 'Edit Attributes' function, to edit the link."));
return false;
}
return true;
}
function bxe_alert(text) {
- var widg = mozilla.getWidgetModalBox("Alert");
+ var widg = mozilla.getWidgetModalBox(bxe_i18n.getText("Alert"));
widg.addText(text);
widg.show(100,50, "fixed");
}
function bxe_validationAlert(messages) {
- var widg = mozilla.getWidgetModalBox("Validation Alert");
+ var widg = mozilla.getWidgetModalBox(bxe_i18n.getText("Validation Alert"));
for (i in messages) {
widg.addText( messages[i]["text"] );
}
Modified: branches/bxe_2_0/js/bxeXMLDocument.js
==============================================================================
--- branches/bxe_2_0/js/bxeXMLDocument.js (original)
+++ branches/bxe_2_0/js/bxeXMLDocument.js Fri Jul 29 11:32:48 2005
@@ -157,7 +157,7 @@
}
catch (e) {
- alert ( e + "\n\n xsltransformdoc.xsldoc is : " + xsltransformdoc.xsldoc);
+ alert ( e + "\n\n "+bxe_i18n.getText("xsltransformdoc.xsldoc is : ") + xsltransformdoc.xsldoc);
}
processor = new XSLTProcessor();
try {
@@ -165,7 +165,7 @@
processor.importStylesheet(newDocument);
} catch(e) {
dump(newDocument.saveXML(newDocument));
- alert("Something went wrong during importing the XSLT document.\n" + bxe_catch_alert_message(e) + "\n" + newDocument.saveXML(newDocument));
+ alert(bxe_i18n.getText("Something went wrong during importing the XSLT document.")+"\n" + bxe_catch_alert_message(e) + "\n" + newDocument.saveXML(newDocument));
}
bxe_config.processor = processor;
/*
@@ -196,12 +196,12 @@
var xhtmldoc = e.currentTarget;
debug ("XHTML loaded");
- bxe_about_box.addText("XHTML loaded...");
+ bxe_about_box.addText(bxe_i18n.getText("XHTML loaded..."));
var bxe_area = document.getElementsByTagName("body")[0];
var bodyInXhtml = xhtmldoc.getElementsByTagName("body");
if (!(bodyInXhtml && bodyInXhtml.length > 0)) {
- bxe_about_box.addText(" Loading Failed. no 'body' element found in your external XHTML document.");
- alert("no 'body' element found in your external XHTML document. ");
+ bxe_about_box.addText(bxe_i18n.getText(" Loading Failed. no 'body' element found in your external XHTML document."));
+ alert(bxe_i18n.getText("no 'body' element found in your external XHTML document. "));
return false;
}
var new_body = document.importNode(bodyInXhtml[0],true);
@@ -221,7 +221,7 @@
xml_loaded(xhtmldoc.xmldoc);
}
- bxe_about_box.addText("Import external XHTML ...");
+ bxe_about_box.addText(bxe_i18n.getText("Import external XHTML ..."));
var xhtmldoc = document.implementation.createDocument("", "", null);
xhtmldoc.addEventListener("load", onload_xhtml, false);
xhtmldoc.xmldoc = this;
@@ -229,7 +229,7 @@
try {
xhtmldoc.load(xhtmlfile);
} catch(e) {
- alert("The xhtmlfile: '" + xhtmlfile + "' was not found");
+ alert(bxe_i18n.getText("The xhtmlfile: '{0}' was not found",new Array(xhtmlfile)));
}
Modified: branches/bxe_2_0/js/i18n.js
==============================================================================
--- branches/bxe_2_0/js/i18n.js (original)
+++ branches/bxe_2_0/js/i18n.js Fri Jul 29 11:32:48 2005
@@ -6,13 +6,19 @@
i18n.prototype.getText = function (key, replacements) {
- var res = this.xml.evaluate("/catalogue/message[@key='"+key+"']/text()", this.xml, null,
+ try {
+
+ var res = this.xml.evaluate("/catalogue/message[@key=\""+key+"\"]/text()", this.xml, null,
XPathResult.ANY_UNORDERED_NODE_TYPE,null).singleNodeValue;
+
if ( res ) {
var string = res.nodeValue;
} else {
var string = key;
}
+ } catch (e) {
+ alert(e + "\n Used key: " + key );
+ }
if (replacements) {
string = eval("'"+string.replace(/\{([0-9]+)\}/g,"'+replacements[$1]+'") + "'");
Modified: branches/bxe_2_0/js/table.js
==============================================================================
--- branches/bxe_2_0/js/table.js (original)
+++ branches/bxe_2_0/js/table.js Fri Jul 29 11:32:48 2005
@@ -66,13 +66,13 @@
var thisColspan = bxe_table_getSpanCount(this.getAttribute("colspan"));
var rightCol = matrix[rowPos][colPos+thisColspan][1];
if (!rightCol) {
- alert("There's no right cell to be merged");
+ alert(bxe_i18n.getText("There's no right cell to be merged"));
return;
}
var rightRowSpanCount = bxe_table_getSpanCount(rightCol.getAttribute("rowspan"));
var thisRowSpanCount = bxe_table_getSpanCount(this.getAttribute("rowspan"));
if (rightRowSpanCount != thisRowSpanCount) {
- alert("Right cell's rowspan is different to this cell's rowspan, merging not possible");
+ alert(bxe_i18n.getText("Right cell's rowspan is different to this cell's rowspan, merging not possible"));
return;
}
@@ -104,12 +104,12 @@
var thisRowspan = bxe_table_getSpanCount(this.getAttribute("rowspan"));
if (!matrix[rowPos + thisRowspan]) {
- alert("There's no cell below to be merged");
+ alert(bxe_i18n.getText("There's no cell below to be merged"));
return;
}
var downCol = matrix[rowPos + thisRowspan][colPos][1];
if (!downCol) {
- alert("There's no cell below to be merged");
+ alert(bxe_i18n.getText("There's no cell below to be merged"));
return;
}
@@ -117,7 +117,7 @@
var thisColSpanCount = bxe_table_getSpanCount(this.getAttribute("colspan"));
if (downColSpanCount != thisColSpanCount) {
- alert("Down cell's colspan is different to this cell's colspan, merging not possible");
+ alert(bxe_i18n.getText("Down cell's colspan is different to this cell's colspan, merging not possible"));
return;
}
@@ -260,12 +260,12 @@
{
output = "<form action=\"javascript:bxe_table_newtable('"+id+"');\" id='bxe_tabelle' name='tabelle'><table class=\"usual\"><tr>";
- output += "<td >Columns</td><td ><input value='5' size=\"3\" name=\"cols\" /></td>\n";
+ output += "<td >"+bxe_i18n.getText("Columns")+"</td><td ><input value='5' size=\"3\" name=\"cols\" /></td>\n";
output += "</tr><tr>\n";
- output += "<td>Rows</td><td ><input value='5' size=\"3\" name=\"rows\" /></td>\n";
+ output += "<td>"+bxe_i18n.getText("Rows")+"</td><td ><input value='5' size=\"3\" name=\"rows\" /></td>\n";
output += "</tr><tr>\n";
output += "<td colspan='2' align='right'>\n";
- output += "<input type='submit' class=\"usual\" value='create' /> </td>";
+ output += "<input type='submit' class=\"usual\" value='"+bxe_i18n.getText("create")+"' /> </td>";
output += "</tr></table></form>";
BX_popup_addHtml(output);
@@ -273,7 +273,7 @@
else
{
- output = "<span class='usual'>Nothing selected, please select the point, where you want the table inserted</span>";
+ output = "<span class='usual'>"+bxe_i18n.getText("Nothing selected, please select the point, where you want the table inserted")+"</span>";
BX_popup_addHtml(output);
}
@@ -399,22 +399,22 @@
if (!(BX_range))
{
- alert("Nothing selected, please select a table cell");
+ alert(bxe_i18n.getText("Nothing selected, please select a table cell"));
return;
}
// <cope> changed != "entry" to "xhtml:td" in order to get the fucking col/rowspan work
if (BX_range.startContainer.parentNode.nodeName.toLowerCase() != "xhtml:td")
{
- alert("No table-cell (but " + BX_range.startContainer.parentNode.nodeName +") selected, please choose one");
+ alert(bxe_i18n.getText("No table-cell (but {0}) selected, please choose one",new Array(BX_range.startContainer.parentNode.nodeName)));
return ;
}
BX_popup_start("Add Row or Col",110,90);
var output = "";
output += "<form action='javascript:bxe_table_insert_row_or_col();' id='bxe_tabelle' name='tabelle'><table class=\"usual\"><tr>";
- output += "<td ><input name='ch' type='radio' value='row' checked='checked' /></td><td >add row</td>\n";
- output += "</tr><tr><td ><input name='ch' type='radio' value='col' /></td><td >add col</td>\n";
+ output += "<td ><input name='ch' type='radio' value='row' checked='checked' /></td><td >"+bxe_i18n.getText("add row")+"</td>\n";
+ output += "</tr><tr><td ><input name='ch' type='radio' value='col' /></td><td >"+bxe_i18n.getText("add col")+"</td>\n";
- output += "</tr><tr><td colspan='2'><input type='submit' class=\"usual\" value='add' /> </td>";
+ output += "</tr><tr><td colspan='2'><input type='submit' class=\"usual\" value='"+bxe_i18n.getText("add")+"' /> </td>";
output += "</tr></table></form>";
BX_popup_addHtml(output);
@@ -754,8 +754,8 @@
}
}
if(colPos == 0) {
- alert("ERROR: could not find the cell in matrix!");
- alert("rowPos: "+rowPos);
+ alert(bxe_i18n.getText("ERROR: could not find the cell in matrix!"));
+ alert(bxe_i18n.getText("rowPos: {0}",new Array(rowPos)));
return false;
}
var pos = new Array();
@@ -947,7 +947,7 @@
//only if matrix gives a cell: [0] == 1
if(matrix[r][c][0] == 1 || matrix[r][c][0] == 2) {
if(matrix[r][c][1] == false) {
- alert("no cell node at r="+r+" c="+c);
+ alert(bxe_i18n.getText("no cell node at r={0} c={1}",new Array(r,c)));
} else {
//a cell without a span or a spaning one
rowNode.appendChild(matrix[r][c][1]);
@@ -991,7 +991,7 @@
var tbody = td.parentNode.parentNode;
- if(tbody.nodeName.toLowerCase() != "table") { alert("got no table body!"); }
+ if(tbody.nodeName.toLowerCase() != "table") { alert(bxe_i18n.getText("got no table body!")); }
return bxe_createTableMatrixFromTable(tbody);
}
Modified: branches/bxe_2_0/js/widget.js
==============================================================================
--- branches/bxe_2_0/js/widget.js (original)
+++ branches/bxe_2_0/js/widget.js Fri Jul 29 11:32:48 2005
@@ -723,7 +723,7 @@
Widget_ContextMenu.prototype.buildElementChooserPopup = function (node, ac ) {
this.Popup.removeAllMenuItems();
- this.Popup.initTitle("Choose Subelement of " + node.vdom.bxeName);
+ this.Popup.initTitle(bxe_i18n.getText("Choose Subelement of {0}",new Array(node.vdom.bxeName)));
ac.sort(bxe_nodeSort);
for (i = 0; i < ac.length; i++) {
if (ac[i].nodeType != 3 && !(ac[i].vdom.bxeDontshow) && !bxe_config.dontShowInContext[ac[i].namespaceURI + ":" +ac[i].localName] && ac[i].vdom.canHaveChildren ) {
@@ -802,7 +802,7 @@
ele.addMenu(this.subPopup,function(e) {
var sub = e.currentTarget.Widget.SubPopup;
sub.removeAllMenuItems();
- sub.setTitle("Append");
+ sub.setTitle(bxe_i18n.getText("Append"));
var newNode = e.currentTarget.Widget.AppendToNode._node;
/*if (newNode.XMLNode.vdom.hasAttributes && e.currentTarget.Widget.EditAttribute) {
var menui = sub.addMenuItem("Edit Attributes..", sub.EditAttributes.popup);
@@ -850,7 +850,7 @@
if (ac.length > 1 || (ac.length == 1 && ac[0].nodeType != 3) ) {
this.addSeparator();
- var ele = this.addMenuItem("Insert ...");
+ var ele = this.addMenuItem(bxe_i18n.getText("Insert ..."));
ele.node.XMLNode = node;
ele.node.addEventListener("mouseover",Widget_XPathMouseOver,false);
ele.node.addEventListener("mouseout",Widget_XPathMouseOut,false);
@@ -860,7 +860,7 @@
var widget = e.currentTarget.Widget;
var sub = widget.SubPopup;
sub.removeAllMenuItems();
- sub.setTitle("Insert");
+ sub.setTitle(bxe_i18n.getText("Insert"));
sub.appendAllowedChildren(widget.AppendToNode);
});
}
@@ -1068,7 +1068,7 @@
var subm = document.createElement("input");
subm.setAttribute("type","submit");
subm.name="__submit";
- subm.setAttribute("value","OK");
+ subm.setAttribute("value",bxe_i18n.getText("OK"));
this.hasTable.parentNode.addEventListener("submit", function(e) {
var Widget = e.currentTarget.Widget;
e.preventDefault();
@@ -1092,7 +1092,7 @@
if (this.doCancel) {
var cancel = document.createElement("input");
cancel.setAttribute("type","reset");
- cancel.setAttribute("value","Cancel");
+ cancel.setAttribute("value",bxe_i18n.getText("Cancel"));
cancel.name="__cancel";
this.hasTable.parentNode.addEventListener("reset", function(e) {
bxe_registerKeyHandlers();
@@ -1133,7 +1133,7 @@
function Widget_ModalAttributeBox() {
- this.setup("Edit Attributes");
+ this.setup(bxe_i18n.getText("Edit Attributes"));
}
Widget_ModalAttributeBox.prototype = new Widget_ModalBox();
@@ -1143,7 +1143,7 @@
var box = mozilla.getWidgetGlobals().EditAttributes;
var xmlnode = e.target.Widget.MenuPopup.MainNode;
- box.reset("Edit Attributes of " + xmlnode.vdom.bxeName, function(values) {
+ box.reset(bxe_i18n.getText("Edit Attributes of {0}",new Array(xmlnode.vdom.bxeName)), function(values) {
this.setAttributes(values);
}
Added: branches/bxe_2_0/lang/fr.xml
==============================================================================
--- (empty file)
+++ branches/bxe_2_0/lang/fr.xml Fri Jul 29 11:32:48 2005
@@ -0,0 +1,111 @@
+<?xml version="1.0"?>
+<catalogue >
+<!-- js/bxeFunctions.js -->
+ <message key="THIS DOCUMENT COULD NOT BE SAVED!\n You are using a Mozilla release with a broken XMLSerializer implementation.\n Mozilla 1.7 and Firefox 0.9/0.9.1 are known to have this bug.\n Please up- or downgrade.">CE DOCUMENT NE PEUT PAS ÊTRE SAUVEGARDÉ!\n Vous utilisez une version de Mozilla avec un XMLSerializer bogué.\n Mozilla 1.7 et Firefox 0.9/0.9.1 ont ce bug.\n Changez de version.</message>
+ <message key="You're in Source Mode. Not possible to use this button">Vous êtes en Mode Source. Il n\'est pas possible d\'utiliser ce bouton</message>
+ <message key="Saving">Sauvegarde en cours</message>
+ <message key="Document couldn't be saved">Le document n\'a pas pu être sauvegardé</message>
+ <message key="Document successfully saved">Le document a bien été sauvegardé</message>
+ <message key="Benchmark ">Benchmark </message>
+ <message key="Total ">Total </message>
+
+ <message key="Edit {0} Attributes">Éditer les attributs de {0}</message>
+ <message key="Copy {0} Element">Copier l\'élément {0}</message>
+ <message key="Append {0} from Clipboard">Ajouter {0} du presse-papiers</message>
+ <message key="Delete {0} Element">Supprimer l\'élément {0}</message>
+ <message key="Deletes the Element and all its children">Supprimer l\'élément et tout ses enfants</message>
+ <message key="Clean ">Nettoyer</message>
+ <message key="Removes the Element, but not its children">Supprimer l\'élément mais pas ses enfants</message>
+ <message key="Move up">Remonter</message>
+ <message key="Move down">Descendre</message>
+ <message key="Split right">Scinder à droite</message>
+ <message key="Split down">Scinder en bas</message>
+ <message key="Merge right">Fusionner à droite</message>
+ <message key="Merge down">Fusionner en bas</message>
+ <message key="Append Row">Ajouter une ligne</message>
+ <message key="Append Col">Ajouter une colonne</message>
+ <message key="Remove Row">Enlever une ligne</message>
+ <message key="Remove Col">Enlever une colonne</message>
+
+ <!-- Menu -->
+ <message key="Save">Sauvegarder</message>
+ <message key="Save & Exit">Sauvegarder & Quitter</message>
+ <message key="Exit">Quitter</message>
+ <message key="File">Fichier</message>
+ <message key="Undo">Annuler</message>
+ <message key="Redo">Refaire</message>
+ <message key="Edit">Éditer</message>
+ <message key="Show XML Document">Afficher le document XML</message>
+ <message key="Show RNG Document">Afficher le document RNG</message>
+ <message key="Debug">Déboguer</message>
+ <message key="About Bitflux Editor">À propos de Bitflux Editor</message>
+ <message key="Help">Aide</message>
+ <message key="BXE Website">Site Web BXE</message>
+ <message key="Show System Info">Afficher les informations systèmes</message>
+ <message key="System Info">Informations systèmes</message>
+ <message key="BXE Version: ">Version de BXE: </message>
+ <message key="BXE Build Date: ">Date de construction BXE: </message>
+ <message key="BXE Revision: ">N� de révision BXE: </message>
+ <message key="User Agent: ">Navigateur : </message>
+ <message key="OK">OK</message>
+ <message key="Report Bug">Rapport de Bogue</message>
+ <message key="Help">Aide</message>
+ <message key="no block found">pas de bloc trouvé</message>
+ <message key="Enter the image url or file name:">Entrez l\'url de l\'image ou son nom de fichier:</message>
+ <message key="Image URL:">URL de l\'image:</message>
+ <message key="{0} is not allowed as child of {1}">{0} n\'est pas un fils de {1}</message>
+ <message key="Table is not allowed here"></message>
+ <message key="Create Table">Créer un tableau</message>
+ <message key="Can't create table: invalid data">Impossible de créer le tableau: données invalides</message>
+ <message key="number of rows">nombre de colonnes</message>
+ <message key="number of cols">nombre de lignes</message>
+ <message key="Enter a URL:">Entrez l\'URL:</message>
+ <message key="ERROR in Bitflux Editor:">Erreur dans Bitflux Editor:</message>
+ <message key="In File: ">Dans le fichier: </message>
+ <message key="Linenumber: ">Ligne: </message>
+ <message key="Type: ">Type: </message>
+ <message key="Stack:">Pile :</message>
+ <message key="You have unsaved changes.\n Click cancel to return to the document.\n Click OK to really leave to page.">Vou avez effectué des changements qui n\'ont pas été sauvegardés.\nCliquez sur cancel pour revenir au document.\nCliquez sur OK pour quitter la page.</message>
+ <message key="There is already a link here, please use the 'Edit Attributes' function, to edit the link.">Ceci est déjà un lien, veuillez utiliser la fonction \'Éditer les attributs\' pour éditer le lien.</message>
+ <message key="Alert">Alerte</message>
+ <message key="Validation Alert">Alerte de Validation</message>
+
+<!-- js/bxeXMLDocument.js -->
+ <message key="xsltransformdoc.xsldoc is : "></message>
+ <message key="Something went wrong during importing the XSLT document."></message>
+ <message key="XHTML loaded..."></message>
+ <message key=" Loading Failed. no 'body' element found in your external XHTML document."></message>
+ <message key="no 'body' element found in your external XHTML document. "></message>
+ <message key="Import external XHTML ..."></message>
+ <message key="The xhtmlfile: '{0}' was not found"></message>
+
+<!-- js/table.js -->
+ <message key="There's no right cell to be merged"></message>
+ <message key="Right cell's rowspan is different to this cell's rowspan, merging not possible"></message>
+ <message key="There's no cell below to be merged"></message>
+ <message key="Down cell's colspan is different to this cell's colspan, merging not possible"></message>
+ <message key="Columns"></message>
+ <message key="Rows"></message>
+ <message key="create">créer</message>
+ <message key="Nothing selected, please select the point, where you want the table inserted"></message>
+ <message key="No table-cell (but {0}) selected, please choose one"></message>
+ <message key="add row">ajouter la ligne</message>
+ <message key="add col">ajouter la colonne</message>
+ <message key="add">ajouter</message>
+ <message key="ERROR: could not find the cell in matrix!"></message>
+ <message key="rowPos: {0}"></message>
+ <message key="no cell node at r={0} c={1}"></message>
+ <message key="got no table body!"></message>
+
+<!-- js/widget.js -->
+ <message key=" Append "> Ajouter </message>
+ <message key="Choose Subelement of {0}">Choisir les sous-éléments de {0}</message>
+ <message key=" Append to "> Ajouter à </message>
+ <message key="Append">Ajouter</message>
+ <message key="Insert ...">Insérer ...</message>
+ <message key="Insert">Insérer</message>
+ <message key="Cancel">Annuler</message>
+ <message key="Edit Attributes">Éditer les attributs</message>
+ <message key="Edit Attributes of {0}">Éditer les attributs de {0}</message>
+
+</catalogue>
--
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.