Skip to content

Commit

Permalink
autosave message is now localizeable
Browse files Browse the repository at this point in the history
  • Loading branch information
w8tcha committed Feb 1, 2014
1 parent 245daa9 commit 81915d1
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions autosave/lang/de.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('autosave', 'de', {
autoSaveMessage: 'Automatisch gespeichert',
loadSavedContent: 'Es wurde ein autom. Gespeicherter Inhalt gefunden (vom "{0}"). Wollen Sie den Inhalt vergleichen, um dann entscheiden zu können ob der Inhalt geladen werden soll?',
title: 'Temp. Gespeichert Inhalt vergleichen',
loadedContent: 'Geladener Inhalt',
Expand Down
1 change: 1 addition & 0 deletions autosave/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('autosave', 'en', {
autoSaveMessage: 'Auto Saved',
loadSavedContent: 'There is a auto-saved version of this content (From "{0}") found. Do you want to open the Compare Dialog, where you can decide to load the auto saved Content?',
title: 'Compare Temp. Saved Content with the Loaded Content of the Site',
loadedContent: 'Loaded Content',
Expand Down
1 change: 1 addition & 0 deletions autosave/lang/jp.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('autosave', 'jp', {
autoSaveMessage: 'Auto Saved',
loadSavedContent: 'There is a auto-saved version of this content (From "{0}") found. Do you want to open the Compare Dialog, where you can decide to load the auto saved Content?',
title: 'Compare Temp. Saved Content with the Loaded Content of the Site',
loadedContent: 'Loaded Content',
Expand Down
1 change: 1 addition & 0 deletions autosave/lang/pl.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('autosave', 'pl', {
autoSaveMessage: 'Auto Saved',
loadSavedContent: 'Istnieje automatycznie zapisana wersja zawartości (z "{0}"). Otworzyć okno porównawcze, w którym można zadecydować o wczytaniu automatycznie zapisanej zawartości?',
title: 'Porównanie tymczasowo zapisanej zawartości z zawartością wczytaną w witrynie',
loadedContent: 'Zawartość wczytania',
Expand Down
1 change: 1 addition & 0 deletions autosave/lang/pt-BR.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('autosave', 'pt-BR', {
autoSaveMessage: 'Auto Saved',
loadSavedContent: 'There is a auto-saved version of this content (From "{0}") found. Do you want to open the Compare Dialog, where you can decide to load the auto saved Content?',
title: 'Compare Temp. Saved Content with the Loaded Content of the Site',
loadedContent: 'Loaded Content',
Expand Down
1 change: 1 addition & 0 deletions autosave/lang/sv.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('autosave', 'sv', {
autoSaveMessage: 'Auto Saved',
loadSavedContent: 'There is a auto-saved version of this content (From "{0}") found. Do you want to open the Compare Dialog, where you can decide to load the auto saved Content?',
loadSavedContent: 'En auto-sparad version av det här innehållet (från "{0}") hittades. Vill du öppna en dialogruta för att jämföra, där du även kan välja att läsa in det auto sparade innehållet?',
title: 'Jämför Temporärt sparat innehåll med det inladdade innehållet från sidan',
Expand Down
1 change: 1 addition & 0 deletions autosave/lang/zh-cn.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('autosave', 'zh', {
autoSaveMessage: 'Auto Saved',
loadSavedContent: 'There is a auto-saved version of this content (From "{0}") found. Do you want to open the Compare Dialog, where you can decide to load the auto saved Content?',
title: 'Compare Temp. Saved Content with the Loaded Content of the Site',
loadedContent: 'Loaded Content',
Expand Down
1 change: 1 addition & 0 deletions autosave/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang('autosave', 'zh', {
autoSaveMessage: 'Auto Saved',
loadSavedContent: 'There is a auto-saved version of this content (From "{0}") found. Do you want to open the Compare Dialog, where you can decide to load the auto saved Content?',
title: 'Compare Temp. Saved Content with the Loaded Content of the Site',
loadedContent: 'Loaded Content',
Expand Down
22 changes: 12 additions & 10 deletions autosave/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,35 @@
}

CKEDITOR.plugins.add("autosave", {
lang: ['de', 'en', 'jp', 'pl', 'pt-BR', 'sv', 'zh', 'zh-cn'],
version: 0.6,
init: function (editor) {
lang: 'de,en,jp,pl,pt-BR,sv,zh,zh-cn', // %REMOVE_LINE_CORE%
version: 0.7,
init: function(editor) {
var autoSaveKey = editor.config.autosave_SaveKey != null ? editor.config.autosave_SaveKey : 'autosave_' + window.location;
var notOlderThan = editor.config.autosave_NotOlderThan != null ? editor.autosave_NotOlderThan : 1440;

CKEDITOR.document.appendStyleSheet(this.path + 'css/autosave.min.css');

CKEDITOR.scriptLoader.load(this.path + 'js/extensions.min.js', function () {
CKEDITOR.scriptLoader.load(this.path + 'js/extensions.min.js', function() {
GenerateAutoSaveDialog(editor, autoSaveKey);

CheckForAutoSavedContent(editor, autoSaveKey, notOlderThan);
});

editor.on('key', startTimer);

editor.on('destroy', function () {
editor.on('destroy', function() {
SaveData(autoSaveKey, editor);
});
editor.on('uiSpace', function (event) {

editor.on('uiSpace', function(event) {
if (event.data.space == 'bottom') {
event.data.html += '<div class="autoSaveMessage" unselectable="on"><div unselectable="on" id="' + autoSaveMessageId(event.editor) + '"class="hidden"' + '>Auto Saved</div></div>';
event.data.html += '<div class="autoSaveMessage" unselectable="on"><div unselectable="on" id="'
+ autoSaveMessageId(event.editor)
+ '"class="hidden">'
+ editorInstance.lang.autosave.autoSaveMessage
+ '</div></div>';
}
}, editor, null, 100);


}
});

Expand Down

0 comments on commit 81915d1

Please sign in to comment.