From f647d597adb5fadce6e21d78bf0d5ff8ad366b0d Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Fri, 26 Aug 2011 20:09:08 +0100 Subject: [PATCH] made the default pad text translatable --- node/utils/Settings.js | 17 ++++++++++++++++- settings.json.template | 3 ++- settings.json.template_windows | 3 ++- translation/de/defaultText.txt | 6 ++++++ 4 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 translation/de/defaultText.txt diff --git a/node/utils/Settings.js b/node/utils/Settings.js index 4c069531c..fa9d588c0 100644 --- a/node/utils/Settings.js +++ b/node/utils/Settings.js @@ -41,7 +41,7 @@ exports.dbSettings = { "filename" : "../var/dirty.db" }; /** * The default Text of a new pad */ -exports.defaultPadText = "Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nEtherpad Lite on Github: http:\/\/j.mp/ep-lite\n"; +exports.defaultPadText = "default"; /** * A flag that shows if minification is enabled or not */ @@ -102,3 +102,18 @@ for(var i in settings) console.warn("This setting doesn't exist or it was removed"); } } + +//replace default text with the language text +if(exports.defaultPadText == "default") +{ + //set the english default text + if(exports.language == "en") + { + exports.defaultPadText = "Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nEtherpad Lite on Github: http:\/\/j.mp/ep-lite\n"; + } + //read the translation + else + { + exports.defaultPadText = fs.readFileSync("../translation/" + exports.language + "/defaultText.txt").toString(); + } +} diff --git a/settings.json.template b/settings.json.template index 0e4ae6309..6cf75a450 100644 --- a/settings.json.template +++ b/settings.json.template @@ -26,7 +26,8 @@ */ //the default text of a pad - "defaultPadText" : "Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nEtherpad Lite on Github: http:\/\/j.mp/ep-lite\n", + //default means the standart text of the used language will be used + "defaultPadText" : "default", /* if true, all css & js will be minified before sending to the client. This will improve the loading performance massivly, but makes it impossible to debug the javascript/css */ diff --git a/settings.json.template_windows b/settings.json.template_windows index 53d016ea7..787baddde 100644 --- a/settings.json.template_windows +++ b/settings.json.template_windows @@ -26,7 +26,8 @@ */ //the default text of a pad - "defaultPadText" : "Welcome to Etherpad Lite!\n\nThis pad text is synchronized as you type, so that everyone viewing this page sees the same text. This allows you to collaborate seamlessly on documents!\n\nEtherpad Lite on Github: http:\/\/j.mp/ep-lite\n", + //default means the standart text of the used language will be used + "defaultPadText" : "default", /* if true, all css & js will be minified before sending to the client. This will improve the loading performance massivly, but makes it impossible to debug the javascript/css */ diff --git a/translation/de/defaultText.txt b/translation/de/defaultText.txt new file mode 100644 index 000000000..2f5dd1b64 --- /dev/null +++ b/translation/de/defaultText.txt @@ -0,0 +1,6 @@ +Willkommen bei Etherpad Lite! + +Während du schreibst wird dieser Text mit dem Server synchronisiert, was bedeutet, dass jeder der diese Seite betrachtet, denselben Text sieht. +Diese Technik erlaubt dir kollaboratives bzw. gemeinschaftliches Arbeiten an Dokumenten in Echtzeit! + +Etherpad Lite findest du auf Github: http://j.mp/ep-lite