Finished translation infrastructure

This commit is contained in:
Peter 'Pita' Martischka 2011-08-26 19:05:35 +01:00
parent 1ad95263cd
commit 839db813f6
15 changed files with 86 additions and 52 deletions

View file

@ -110,7 +110,7 @@ async.waterfall([
var id = req.params.id; var id = req.params.id;
if(id == "pad.js" || id == "timeslider.js") if(id == "pad.js" || id == "timeslider.js" || id == "index.js")
{ {
minify.minifyJS(req,res,id); minify.minifyJS(req,res,id);
} }

View file

@ -33,7 +33,9 @@ var os = require('os');
var padJS = ["jquery.min.js", "translate.js", "LANGUAGE", "pad_utils.js", "plugins.js", "undo-xpopup.js", "json2.js", "pad_cookie.js", "pad_editor.js", "pad_editbar.js", "pad_docbar.js", "pad_modals.js", "ace.js", "collab_client.js", "pad_userlist.js", "pad_impexp.js", "pad_savedrevs.js", "pad_connectionstatus.js", "pad2.js", "jquery-ui.js", "chat.js", "excanvas.js", "farbtastic.js"]; var padJS = ["jquery.min.js", "translate.js", "LANGUAGE", "pad_utils.js", "plugins.js", "undo-xpopup.js", "json2.js", "pad_cookie.js", "pad_editor.js", "pad_editbar.js", "pad_docbar.js", "pad_modals.js", "ace.js", "collab_client.js", "pad_userlist.js", "pad_impexp.js", "pad_savedrevs.js", "pad_connectionstatus.js", "pad2.js", "jquery-ui.js", "chat.js", "excanvas.js", "farbtastic.js"];
var timesliderJS = ["jquery.min.js", "plugins.js", "undo-xpopup.js", "json2.js", "colorutils.js", "draggable.js", "pad_utils.js", "pad_cookie.js", "pad_editor.js", "pad_editbar.js", "pad_docbar.js", "pad_modals.js", "easysync2_client.js", "domline_client.js", "linestylefilter_client.js", "cssmanager_client.js", "broadcast.js", "broadcast_slider.js", "broadcast_revisions.js"]; var timesliderJS = ["jquery.min.js", "translate.js", "LANGUAGE", "plugins.js", "undo-xpopup.js", "json2.js", "colorutils.js", "draggable.js", "pad_utils.js", "pad_cookie.js", "pad_editor.js", "pad_editbar.js", "pad_docbar.js", "pad_modals.js", "easysync2_client.js", "domline_client.js", "linestylefilter_client.js", "cssmanager_client.js", "broadcast.js", "broadcast_slider.js", "broadcast_revisions.js"];
var indexJS = ["jquery.min.js", "translate.js", "LANGUAGE"];
/** /**
* creates the minifed javascript for the given minified name * creates the minifed javascript for the given minified name
@ -53,6 +55,10 @@ exports.minifyJS = function(req, res, jsFilename)
{ {
jsFiles = timesliderJS; jsFiles = timesliderJS;
} }
else if(jsFilename == "index.js")
{
jsFiles = indexJS;
}
else else
{ {
throw new Error("there is no profile for creating " + name); throw new Error("there is no profile for creating " + name);
@ -71,6 +77,12 @@ exports.minifyJS = function(req, res, jsFilename)
{ {
var folders2check = ["../static/css","../static/js"]; var folders2check = ["../static/css","../static/js"];
//check the language folder for changes too, expect this is english
if(settings.language != "en")
{
folders2check.push("../translation/" + settings.language);
}
//go trough this two folders //go trough this two folders
async.forEach(folders2check, function(path, callback) async.forEach(folders2check, function(path, callback)
{ {
@ -143,7 +155,7 @@ exports.minifyJS = function(req, res, jsFilename)
} }
//replace it with the translation file //replace it with the translation file
fileName = "../translation/" + settings.language + "/pad.json"; fileName = "../translation/" + settings.language + "/" + jsFilename.split(".")[0] + ".json";
} }
fs.readFile(fileName, "utf-8", function(err, data) fs.readFile(fileName, "utf-8", function(err, data)

View file

@ -1084,7 +1084,7 @@ position: relative;
#importsubmitinput{ #importsubmitinput{
height:25px; height:25px;
width:85px; width:130px;
margin-top:12px; margin-top:12px;
} }
@ -1146,4 +1146,4 @@ width:33px !important;
#editbar ul li { #editbar ul li {
padding: 4px 1px; padding: 4px 1px;
} }
} }

View file

@ -19,7 +19,7 @@
position: absolute; position: absolute;
left:0px; left:0px;
background-image: url(../../static/img/timeslider_left.png); background-image: url(../../static/img/timeslider_left.png);
width: 134px; width: 200px;
height: 63px; height: 63px;
} }
@ -164,7 +164,7 @@ div #timeslider div#steppers div#rightstep {
font-family: Arial, sans-serif; font-family: Arial, sans-serif;
left: 7px; left: 7px;
top: 9px; top: 9px;
width: 122px; width: 188px;
text-align: center; text-align: center;
color: white; color: white;
font-size: 11px; font-size: 11px;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 686 B

After

Width:  |  Height:  |  Size: 494 B

Before After
Before After

View file

@ -86,10 +86,11 @@
input[type="submit"]::-moz-focus-inner { border: 0 } input[type="submit"]::-moz-focus-inner { border: 0 }
@-moz-document url-prefix() { input[type="submit"] { padding: 7px } } @-moz-document url-prefix() { input[type="submit"] { padding: 7px } }
</style> </style>
<script src="minified/index.js"></script>
<link href="static/custom/index.css" rel="stylesheet"> <link href="static/custom/index.css" rel="stylesheet">
<script src="static/custom/index.js"></script> <script src="static/custom/index.js"></script>
<div id="container"> <div id="container">
<div id="button" onclick="go2Random()">New Pad</div><br><div id="label">or create/open a Pad with the name</div> <div id="button" onclick="go2Random()" class="translate">New Pad</div><br><div id="label" class="translate">or create/open a Pad with the name</div>
<form action="#" onsubmit="go2Name();return false;"> <form action="#" onsubmit="go2Name();return false;">
<input type="text" id="padname" autofocus> <input type="text" id="padname" autofocus>
<input type="submit" value="OK"> <input type="submit" value="OK">
@ -123,4 +124,4 @@
//start the costum js //start the costum js
if(typeof costumStart == "function") costumStart(); if(typeof costumStart == "function") costumStart();
</script> </script>
</html> </html>

View file

@ -336,9 +336,10 @@ function loadBroadcastJS()
$('#timer').html(dateFormat()); $('#timer').html(date.toLocaleString());
var revisionDate = ["Saved", ["Jan", "Feb", "March", "April", "May", "June", "July", "Aug", "Sept", "Oct", "Nov", "Dec"][date.getMonth()], date.getDate() + ",", date.getFullYear()].join(" ") var revisionDate = translate("Saved at") + " " + date.toLocaleDateString();
$('#revision_date').html(revisionDate) $('#revision_date').html(revisionDate)
} }

View file

@ -109,7 +109,7 @@ function loadBroadcastSliderJS()
{ {
$(this).attr('href', $(this).attr('thref').replace("%revision%", newpos)); $(this).attr('href', $(this).attr('thref').replace("%revision%", newpos));
}); });
$("#revision_label").html("Version " + newpos); $("#revision_label").html(translate("Version") + " " + newpos);
if (newpos == 0) if (newpos == 0)
{ {
@ -325,7 +325,7 @@ function loadBroadcastSliderJS()
var newloc = self.currentLoc + (evt2.clientX - self.startLoc); var newloc = self.currentLoc + (evt2.clientX - self.startLoc);
if (newloc < 0) newloc = 0; if (newloc < 0) newloc = 0;
if (newloc > ($("#ui-slider-bar").width() - 2)) newloc = ($("#ui-slider-bar").width() - 2); 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(translate("Version") + " " + Math.floor(newloc * sliderLength / ($("#ui-slider-bar").width() - 2)));
$(self).css('left', newloc); $(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))) if (getSliderPosition() != Math.floor(newloc * sliderLength / ($("#ui-slider-bar").width() - 2))) _callSliderCallbacks(Math.floor(newloc * sliderLength / ($("#ui-slider-bar").width() - 2)))
}); });

View file

@ -198,19 +198,19 @@ function handshake()
{ {
if(obj.accessStatus == "deny") if(obj.accessStatus == "deny")
{ {
$("#editorloadingbox").html("<b>You do not have permission to access this pad</b>"); $("#editorloadingbox").html("<b>" + translate("You do not have permission to access this pad") + "</b>");
} }
else if(obj.accessStatus == "needPassword") else if(obj.accessStatus == "needPassword")
{ {
$("#editorloadingbox").html("<b>You need a password to access this pad</b><br>" + $("#editorloadingbox").html("<b>" + translate("You need a password to access this pad") + "</b><br>" +
"<input id='passwordinput' type='password' name='password'>"+ "<input id='passwordinput' type='password' name='password'>"+
"<button type='button' onclick='savePassword()'>ok</button>"); "<button type='button' onclick='savePassword()'>" + translate("ok") + "</button>");
} }
else if(obj.accessStatus == "wrongPassword") else if(obj.accessStatus == "wrongPassword")
{ {
$("#editorloadingbox").html("<b>You're password was wrong</b><br>" + $("#editorloadingbox").html("<b>" + translate("You're password was wrong") + "</b><br>" +
"<input id='passwordinput' type='password' name='password'>"+ "<input id='passwordinput' type='password' name='password'>"+
"<button type='button' onclick='savePassword()'>ok</button>"); "<button type='button' onclick='savePassword()'>" + translate("ok") + "</button>");
} }
} }

View file

@ -62,7 +62,7 @@ var padimpexp = (function()
function fileInputSubmit() function fileInputSubmit()
{ {
$('#importmessagefail').fadeOut("fast"); $('#importmessagefail').fadeOut("fast");
var ret = window.confirm("Importing a file will overwrite the current text of the pad." + " Are you sure you want to proceed?"); var ret = window.confirm(translate("Importing a file will overwrite the current text of the pad. Are you sure you want to proceed?"));
if (ret) if (ret)
{ {
hidePanelCall = paddocbar.hideLaterIfNoOtherInteraction(); hidePanelCall = paddocbar.hideLaterIfNoOtherInteraction();
@ -78,7 +78,7 @@ var padimpexp = (function()
$('#importsubmitinput').attr( $('#importsubmitinput').attr(
{ {
disabled: true disabled: true
}).val("Importing..."); }).val(translate("Importing..."));
window.setTimeout(function() window.setTimeout(function()
{ {
$('#importfileinput').attr( $('#importfileinput').attr(
@ -106,7 +106,7 @@ var padimpexp = (function()
function importDone() function importDone()
{ {
$('#importsubmitinput').removeAttr('disabled').val("Import Now"); $('#importsubmitinput').removeAttr('disabled').val(translate("Import Now"));
window.setTimeout(function() window.setTimeout(function()
{ {
$('#importfileinput').removeAttr('disabled'); $('#importfileinput').removeAttr('disabled');
@ -243,7 +243,7 @@ var padimpexp = (function()
$("#exportopena").remove(); $("#exportopena").remove();
$("#importexport").css({"height":"95px"}); $("#importexport").css({"height":"95px"});
$("#importexportline").css({"height":"95px"}); $("#importexportline").css({"height":"95px"});
$("#import").html("Import is not available"); $("#import").html(translate("Import is not available"));
} }
else if(clientVars.abiwordAvailable == "withoutPDF") else if(clientVars.abiwordAvailable == "withoutPDF")
{ {

View file

@ -169,9 +169,7 @@
<div id="editorcontainer"> <div id="editorcontainer">
<!-- --> <!-- -->
</div> </div>
<div id="editorloadingbox"> <div id="editorloadingbox" class="translate">Loading...</div>
Loading...
</div>
</div> </div>
@ -197,6 +195,8 @@
</form> </form>
</div> </div>
<script>DOMTranslate("#importsubmitinput", "value");</script>
<div id="importexportline"></div> <div id="importexportline"></div>
<div id="export"> <div id="export">
@ -270,9 +270,9 @@
<span class="translate">Reestablishing connection...</span> <span class="translate">Reestablishing connection...</span>
</div> </div>
<div class="disconnected"> <div class="disconnected">
<h2 class="h2_disconnect">Disconnected.</h2> <h2 class="h2_disconnect translate">Disconnected.</h2>
<h2 class="h2_userdup">Opened in another window.</h2> <h2 class="h2_userdup translate">Opened in another window.</h2>
<h2 class="h2_unauth">No Authorization.</h2> <h2 class="h2_unauth translate">No Authorization.</h2>
<div id="disconnected_looping"> <div id="disconnected_looping">
<p> <p>
<b><span class="translate">We're having trouble talking to the EtherPad lite synchronization server.</span></b> <b><span class="translate">We're having trouble talking to the EtherPad lite synchronization server.</span></b>

View file

@ -269,7 +269,7 @@
<div id="editbarright" class="editbarright"> <div id="editbarright" class="editbarright">
<!-- termporary place holder--> <!-- termporary place holder-->
<a id = "returnbutton">Return to pad</a> <a id = "returnbutton" class="translate">Return to pad</a>
<script> <script>
$("#returnbutton").attr("href", document.referrer); $("#returnbutton").attr("href", document.referrer);
</script> </script>

View file

@ -0,0 +1,4 @@
{
"New Pad":"Neues Pad",
"or create/open a Pad with the name":"oder erstelle/öffne ein Pad mit dem Namen"
}

View file

@ -6,42 +6,53 @@
"Toggle Bullet List":"Liste", "Toggle Bullet List":"Liste",
"Indent List":"Liste einrücken", "Indent List":"Liste einrücken",
"Unindent List":"Liste ausrücken", "Unindent List":"Liste ausrücken",
"Undo (ctrl-Z)":"Rückgängig", "Undo (ctrl-Z)":"Rückgängig machen",
"Redo (ctrl-Y)":"Widerholen", "Redo (ctrl-Y)":"Wiederholen",
"Clear Authorship Colors":"Autorenfarben entfernen", "Clear Authorship Colors":"Autorenfarben entfernen",
"Create a readonly link for this pad":"Erzeuge einen Nur-Lese Link", "Create a readonly link for this pad":"Erzeuge einen schreibgeschützten Link",
"Import/Export from/to different document formats":"Importiere/Exportiere von und zu verschiedenen Dokumentformaten", "Import/Export from/to different document formats":"Importiere/Exportiere von und zu verschiedenen Dokumentformaten",
"Embed this pad":"Binde dieses Pad in deine Webseite ein", "Embed this pad":"Bette dieses Pad in eine Webseite ein",
"Show the history of this pad":"Zeige den Verlauf des Pads", "Show the history of this pad":"Zeige den Verlauf des Pads",
"Show connected users":"Zeige verbundene Benutzer", "Show connected users":"Zeige verbundene Benutzer",
"Cancel":"Abrechen", "Cancel":"Abbrechen",
"Save":"Speichern", "Save":"Speichern",
"Import from text file, HTML, PDF, Word, ODT or RTF:":"Importiere von Text, HTML, PDF, Word, ODT oder RTF:", "Import from text file, HTML, PDF, Word, ODT or RTF:":"Importiere von Text, HTML, PDF, Word, ODT oder RTF:",
"Successful!":"Erfolgreich!", "Successful!":"Erfolgreich!",
"Export current pad as:":"Exportiere dieses Pad als", "Export current pad as:":"Exportiere dieses Pad als",
"HTML":"HTML", "HTML":"HTML",
"Plain text":"Reiner Text", "Plain text":"Nur Text",
"Microsoft Word":"Microsoft Word", "Microsoft Word":"Microsoft Word",
"PDF":"PDF", "PDF":"PDF",
"OpenDocument":"OpenDocument", "OpenDocument":"OpenDocument",
"Wordle":"Wordle", "Wordle":"Wordle",
"Embed code:":"Einbett code", "Embed code:":"Einbett-Code",
"Use this link to share a read-only version of your pad:":"Nutze diesen Link um mit deinen Freunden eine Nur-Lese zu teilen", "Use this link to share a read-only version of your pad:":"Nutze diesen Link um mit deinen Freunden einen schreibgeschützte Version zu teilen",
"Chat":"Chat", "Chat":"Chat",
"Connecting...":"Verbinde...", "Connecting...":"Verbinde...",
"Reestablishing connection...":"Baue verbindung neu auf...", "Loading...":"Laden...",
"We're having trouble talking to the EtherPad lite synchronization server.":"Wir haben Probleme uns zu verbinden", "Reestablishing connection...":"Baue Verbindung neu auf...",
"You may be connecting through an incompatible firewall or proxy server.":"", "Disconnected.": "Verbindung verloren.",
"We were unable to connect to the EtherPad lite synchronization server.":"", "Opened in another window.": "In einem anderen Fenster geöffnet.",
"This may be due to an incompatibility with your web browser or internet connection.":"", "No Authorization.": "Keine Berechtigung.",
"You seem to have opened this pad in another browser window.":"", "We're having trouble talking to the EtherPad lite synchronization server.":"Wir haben Probleme uns mit dem Synchronisationsserver zu verbinden.",
"If you'd like to use this window instead, you can reconnect.":"", "You may be connecting through an incompatible firewall or proxy server.":"Möglicherweise verbietet deine Firewall die Verbindung.",
"Lost connection with the EtherPad lite synchronization server.":"", "We were unable to connect to the EtherPad lite synchronization server.":"Es war uns nicht möglich mit Synchronisationsserver zu kommunizieren.",
"Server not responding.":"", "This may be due to an incompatibility with your web browser or internet connection.":"Dies könnte ein Problem mit deinem Browser oder deiner Internetverbindung sein",
"This may be due to network connectivity issues or high load on the server.":"", "You seem to have opened this pad in another browser window.":"Vermutlich hast du dieses Pad in einem anderen Fenster geöffnet.",
"Your browser's credentials or permissions have changed while viewing this pad. Try reconnecting.":"", "If you'd like to use this window instead, you can reconnect.":"Wenn du lieber dieses Fenster verwenden willst, drücke auf 'Jetzt neu verbinden'.",
"This pad was deleted.":"Dieses Pad wurde gelöscht", "Lost connection with the EtherPad lite synchronization server.":"Wir haben die Verbindung mit dem Etherpad Lite Server verloren.",
"If this continues to happen, please let us know":"Sollte dies wiederholt passieren, informieren sie uns bitte darüber", "Server not responding.":"Der Server antwortet nicht.",
"This may be due to network connectivity issues or high load on the server.":"Dies könnte an einer schlechten Verbindung oder einer hohen Last auf dem Server liegen.",
"Your browser's credentials or permissions have changed while viewing this pad. Try reconnecting.":"Deine Verbindungsdaten haben sich geändert während du auf dem Pad warst. Bitte versuche es erneut.",
"This pad was deleted.":"Dieses Pad wurde gelöscht.",
"If this continues to happen, please let us know":"Sollte dies wiederholt passieren, informiere uns bitte darüber.",
"Reconnect Now":"Jetzt neu verbinden", "Reconnect Now":"Jetzt neu verbinden",
"Enter your name":"Namen eingeben" "Enter your name":"Namen eingeben",
"You do not have permission to access this pad":"Du hast keine Befugnis auf dieses Pad zuzugreifen",
"You need a password to access this pad":"Du benötigst ein Passwort um auf dieses Pad zuzugreifen",
"You're password was wrong":"Dein Passwort war falsch",
"Import is not available":"Import ist nicht verfügbar",
"Importing a file will overwrite the current text of the pad. Are you sure you want to proceed?":"Der Import einer Datei wird den aktuellen Padinhalt überschreiben. Fortfahren?",
"Import Now":"Jetzt importieren",
"Importing...":"Importieren..."
} }

View file

@ -0,0 +1,5 @@
{
"Return to pad":"Zurück zum Pad",
"Version": "Version",
"Saved at": "Gespeichert am"
}