From 8dd52ed79ab67249ad17d38443df2f1c29cbfe97 Mon Sep 17 00:00:00 2001 From: Lukas Weiss Date: Wed, 21 Mar 2018 14:48:05 +0100 Subject: [PATCH] Add language files for english and german --- footnotes/dialogs/footnotes.js | 10 +++++----- footnotes/lang/de.js | 17 +++++++++++++++++ footnotes/lang/en.js | 17 +++++++++++++++++ footnotes/plugin.js | 3 ++- 4 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 footnotes/lang/de.js create mode 100644 footnotes/lang/en.js diff --git a/footnotes/dialogs/footnotes.js b/footnotes/dialogs/footnotes.js index c7e1c08..9b5c28b 100644 --- a/footnotes/dialogs/footnotes.js +++ b/footnotes/dialogs/footnotes.js @@ -15,7 +15,7 @@ return { editor_name: false, // Basic properties of the dialog window: title, minimum size. - title: 'Manage Footnotes', + title: editor.lang.footnotes.dialog.title, minWidth: 400, minHeight: 200, footnotes_el: false, @@ -25,7 +25,7 @@ { // Definition of the Basic Settings dialog tab (page). id: 'tab-basic', - label: 'Basic Settings', + label: editor.lang.footnotes.dialog.basicSettings, // The tab contents. elements: [ @@ -34,7 +34,7 @@ type: 'textarea', id: 'new_footnote', 'class': 'footnote_text', - label: 'New footnote:', + label: editor.lang.footnotes.dialog.fields.text, inputStyle: 'height: 100px', }, { @@ -42,7 +42,7 @@ type: 'text', id: 'footnote_id', name: 'footnote_id', - label: 'No existing footnotes', + label: editor.lang.footnotes.dialog.fields.id, // Called by the main setupContent call on dialog initialization. @@ -60,7 +60,7 @@ if ($footnotes.length > 0) { if ($el.find('p').length == 0) { - $el.append('

OR: Choose footnote:

    '); + $el.append('

    ' + editor.lang.footnotes.dialog.texts.or + ' ' + editor.lang.footnotes.dialog.texts.choose + '

      '); } else { $el.find('ol').empty(); } diff --git a/footnotes/lang/de.js b/footnotes/lang/de.js new file mode 100644 index 0000000..5b44610 --- /dev/null +++ b/footnotes/lang/de.js @@ -0,0 +1,17 @@ +CKEDITOR.plugins.setLang('footnotes', 'de', { + buttons: { + add: 'Fußnote einfügen' + }, + dialog: { + title: 'Fußnoten verwalten', + basicSettings: 'Einstellungen', + fields: { + text: 'Neue Fußnote:', + id: 'Keine Fußnoten vorhanden' + }, + texts: { + or: 'ODER', + choose: 'vorhandene Fußnote verwenden:' + } + } +}); diff --git a/footnotes/lang/en.js b/footnotes/lang/en.js new file mode 100644 index 0000000..ed3cde7 --- /dev/null +++ b/footnotes/lang/en.js @@ -0,0 +1,17 @@ +CKEDITOR.plugins.setLang('footnotes', 'en', { + buttons: { + add: 'Insert Footnotes' + }, + dialog: { + title: 'Manage Footnotes', + basicSettings: 'Basic Settings', + fields: { + text: 'New footnote:', + id: 'No existing footnotes' + }, + texts: { + or: 'OR', + choose: 'choose footnote:' + } + } +}); diff --git a/footnotes/plugin.js b/footnotes/plugin.js index dfd4a24..fbbefd5 100644 --- a/footnotes/plugin.js +++ b/footnotes/plugin.js @@ -16,6 +16,7 @@ footnote_ids: [], requires: 'widget', icons: 'footnotes', + lang: 'en,de', // The plugin initialization logic goes inside this method. @@ -123,7 +124,7 @@ editor.ui.addButton('Footnotes', { // The text part of the button (if available) and tooptip. - label: 'Insert Footnotes', + label: editor.lang.footnotes.buttons.add, // The command to execute on click. command: 'footnotes',