User:Hippietrail/localisenavbars.js

//importScript('User:Hippietrail/wfMsgCentre.js'); document.write('<\/script>');

var wgNavBarMsgArray;

function localisenavbars { if (wgNavBarArray && wgNavBarArray.length > 0 && wgUserLanguage != wgContentLanguage) { var msgctr = wfMsgCentreFactory.create; wgNavBarMsgArray = new Object;

wgNavBarMsgArray['Hidetoc'] = { forcontent: true, obj: window, attr: 'NavigationBarHide', xform: hide_cb }; wgNavBarMsgArray['Showtoc'] = { forcontent: true, obj: window, attr: 'NavigationBarShow', xform: show_cb };

msgctr.batch(wgNavBarMsgArray); } }

function hide_cb(text) { for (var b in wgNavBarArray) if (!wgNavBarArray[b].isHidden) wgNavBarArray[b].childNodes[1].firstChild.nodeValue = text;

return text; }

function show_cb(text) { for (var b in wgNavBarArray) if (wgNavBarArray[b].isHidden) wgNavBarArray[b].childNodes[1].firstChild.nodeValue = text;

return text; }