From 94e9cf0a328c110133079c1df26ae418ad22b5fb Mon Sep 17 00:00:00 2001 From: Simon Leblanc Date: Fri, 23 Nov 2012 06:20:09 +0100 Subject: [PATCH 1/3] improving the translation of the timeline --- src/locales/en.ini | 17 ++++++++++++++++- src/static/js/broadcast.js | 28 ++++++++++++++++++++++++++-- src/static/js/broadcast_slider.js | 6 +++--- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/src/locales/en.ini b/src/locales/en.ini index a110583e..e542594d 100644 --- a/src/locales/en.ini +++ b/src/locales/en.ini @@ -74,4 +74,19 @@ timeslider.pageTitle = {{appTitle}} Timeslider timeslider.toolbar.returnbutton = Return to pad timeslider.toolbar.authors = Authors: timeslider.toolbar.authorsList = No Authors -timeslider.exportCurrent = Export current version as: \ No newline at end of file +timeslider.exportCurrent = Export current version as: +timeslider.version = Version {{version}} +timeslider.saved = Saved {{month}} {{day}}, {{year}} +timeslider.dateformat = {{month}}/{{day}}/{{year}} {{hours}}:{{minutes}}:{{seconds}} +timeslider.month.january = January +timeslider.month.february = February +timeslider.month.march = March +timeslider.month.april = April +timeslider.month.may = May +timeslider.month.june = June +timeslider.month.july = July +timeslider.month.august = August +timeslider.month.september = September +timeslider.month.october = October +timeslider.month.november = November +timeslider.month.december = December diff --git a/src/static/js/broadcast.js b/src/static/js/broadcast.js index 86e63f93..d67398fb 100644 --- a/src/static/js/broadcast.js +++ b/src/static/js/broadcast.js @@ -304,7 +304,14 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro var hours = zpad(date.getHours(), 2); var minutes = zpad(date.getMinutes(), 2); var seconds = zpad(date.getSeconds(), 2); - return ([month, '/', day, '/', year, ' ', hours, ':', minutes, ':', seconds].join("")); + return (document.webL10n.get("timeslider.dateformat", { + "day": day, + "month": month, + "year": year, + "hours": hours, + "minutes": minutes, + "seconds": seconds + })); } @@ -313,7 +320,24 @@ function loadBroadcastJS(socket, sendSocketMsg, fireWhenAllScriptsAreLoaded, Bro $('#timer').html(dateFormat()); - var revisionDate = ["Saved", ["Jan", "Feb", "March", "April", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"][date.getMonth()], date.getDate() + ",", date.getFullYear()].join(" ") + var revisionDate = document.webL10n.get("timeslider.saved", { + "day": date.getDate(), + "month": [ + document.webL10n.get("timeslider.month.january"), + document.webL10n.get("timeslider.month.february"), + document.webL10n.get("timeslider.month.march"), + document.webL10n.get("timeslider.month.april"), + document.webL10n.get("timeslider.month.may"), + document.webL10n.get("timeslider.month.june"), + document.webL10n.get("timeslider.month.july"), + document.webL10n.get("timeslider.month.august"), + document.webL10n.get("timeslider.month.september"), + document.webL10n.get("timeslider.month.october"), + document.webL10n.get("timeslider.month.november"), + document.webL10n.get("timeslider.month.december") + ][date.getMonth()], + "year": date.getFullYear() + }); $('#revision_date').html(revisionDate) } diff --git a/src/static/js/broadcast_slider.js b/src/static/js/broadcast_slider.js index fed9f2e7..a597c926 100644 --- a/src/static/js/broadcast_slider.js +++ b/src/static/js/broadcast_slider.js @@ -112,7 +112,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) { $(this).attr('href', $(this).attr('thref').replace("%revision%", newpos)); }); - $("#revision_label").html("Version " + newpos); + $("#revision_label").html(document.webL10n.get("timeslider.version", { "version": newpos})); if (newpos == 0) { @@ -215,7 +215,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) } if (authors.length == 0) { - authorsList.append("No Authors"); + authorsList.append(document.webL10n.get("timeslider.toolbar.authorsList")); } fixPadHeight(); @@ -346,7 +346,7 @@ function loadBroadcastSliderJS(fireWhenAllScriptsAreLoaded) var newloc = self.currentLoc + (evt2.clientX - self.startLoc); if (newloc < 0) newloc = 0; if (newloc > ($("#ui-slider-bar").width() - 2)) newloc = ($("#ui-slider-bar").width() - 2); - $("#revision_label").html("Version " + Math.floor(newloc * sliderLength / ($("#ui-slider-bar").width() - 2))); + $("#revision_label").html(document.webL10n.get("timeslider.version", { "version": Math.floor(newloc * sliderLength / ($("#ui-slider-bar").width() - 2))})); $(self).css('left', newloc); if (getSliderPosition() != Math.floor(newloc * sliderLength / ($("#ui-slider-bar").width() - 2))) _callSliderCallbacks(Math.floor(newloc * sliderLength / ($("#ui-slider-bar").width() - 2))) }); From 6239c66e3639bfed8345dabf304c4f4578dd67ed Mon Sep 17 00:00:00 2001 From: John McLear Date: Mon, 26 Nov 2012 20:19:27 +0000 Subject: [PATCH 2/3] remove alert on line wrap as it doesnt mean anything --- src/static/js/ace2_inner.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/static/js/ace2_inner.js b/src/static/js/ace2_inner.js index 661ea011..b3bc91a9 100644 --- a/src/static/js/ace2_inner.js +++ b/src/static/js/ace2_inner.js @@ -333,14 +333,6 @@ function Ace2Inner(){ return colorutils.triple2css(color); } - function doAlert(str) - { - scheduler.setTimeout(function() - { - alert(str); - }, 0); - } - editorInfo.ace_getRep = function() { return rep; @@ -1624,7 +1616,7 @@ function Ace2Inner(){ if (linesWrapped > 0) { - doAlert("Editor warning: " + linesWrapped + " long line" + (linesWrapped == 1 ? " was" : "s were") + " hard-wrapped into " + ccData.numLinesAfter + " lines."); + // console.log("Editor warning: " + linesWrapped + " long line" + (linesWrapped == 1 ? " was" : "s were") + " hard-wrapped into " + ccData.numLinesAfter + " lines."); } if (ss[0] >= 0) selStart = [ss[0] + a + netNumLinesChangeSoFar, ss[1]]; From bf26f60bac93b104cef2986a45ac51b000674b64 Mon Sep 17 00:00:00 2001 From: Manuel Knitza Date: Tue, 27 Nov 2012 09:59:47 +0100 Subject: [PATCH 3/3] Update doc/api/http_api.md As EPL moved from "Pita" to "ether" the edited link had to be changed. --- doc/api/http_api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/http_api.md b/doc/api/http_api.md index 990d1b49..7ace1b0b 100644 --- a/doc/api/http_api.md +++ b/doc/api/http_api.md @@ -9,7 +9,7 @@ The API gives another web application control of the pads. The basic functions a The API is designed in a way, so you can reuse your existing user system with their permissions, and map it to etherpad lite. Means: Your web application still has to do authentication, but you can tell etherpad lite via the api, which visitors should get which permissions. This allows etherpad lite to fit into any web application and extend it with real-time functionality. You can embed the pads via an iframe into your website. -Take a look at [HTTP API client libraries](https://github.com/Pita/etherpad-lite/wiki/HTTP-API-client-libraries) to see if a library in your favorite language. +Take a look at [HTTP API client libraries](https://github.com/ether/etherpad-lite/wiki/HTTP-API-client-libraries) to see if a library in your favorite language. ## Examples