Skip to content

Commit

Permalink
🌐 Add German translations
Browse files Browse the repository at this point in the history
WIKI-196
  • Loading branch information
micgro42 committed Aug 27, 2018
1 parent 837f1fe commit 3d5c820
Show file tree
Hide file tree
Showing 25 changed files with 232 additions and 72 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Expand Up @@ -32,6 +32,7 @@ module.exports = {
globals: {
JSINFO: false,
DOKU_BASE: false,
LANG: false,
},
rules,
};
62 changes: 31 additions & 31 deletions action/editor.php
Expand Up @@ -154,7 +154,7 @@ public function addAddtionalForms(Doku_Event $event)
'type' => 'button',
'class' => 'js-open-linkwiz linkform_linkwiz'
]);
$linkForm->addTextInput('linktarget', 'Link target')->attrs(
$linkForm->addTextInput('linktarget', $this->getLang('link target'))->attrs(
[
'required'=> 'required',
'autofocus' => 'autofocus',
Expand All @@ -166,11 +166,11 @@ public function addAddtionalForms(Doku_Event $event)
$linkForm->addTagOpen('legend');
$linkForm->addHTML('Link Type');
$linkForm->addTagClose('legend');
$linkForm->addRadioButton('linktype', 'Wiki page')->val('internallink');
$linkForm->addRadioButton('linktype', 'Interwiki')->val('interwikilink');
$linkForm->addRadioButton('linktype', 'email')->val('emaillink');
$linkForm->addRadioButton('linktype', 'external')->val('externallink')->attr('checked', 'checked');
$linkForm->addRadioButton('linktype', 'Other')->val('other');
$linkForm->addRadioButton('linktype', $this->getLang('type:wiki page'))->val('internallink');
$linkForm->addRadioButton('linktype', $this->getLang('type:interwiki'))->val('interwikilink');
$linkForm->addRadioButton('linktype', $this->getLang('type:email'))->val('emaillink');
$linkForm->addRadioButton('linktype', $this->getLang('type:external'))->val('externallink')->attr('checked', 'checked');
$linkForm->addRadioButton('linktype', $this->getLang('type:other'))->val('other');
$linkForm->addTagClose('fieldset');
$linkForm->addTagClose('div');

Expand All @@ -179,10 +179,10 @@ public function addAddtionalForms(Doku_Event $event)
$linkForm->addTagOpen('legend');
$linkForm->addHTML('Link Name Type');
$linkForm->addTagClose('legend');
$linkForm->addRadioButton('nametype', 'automatic')->val('automatic')->attr('checked', 'checked');
$linkForm->addRadioButton('nametype', 'custom')->val('custom');
$linkForm->addRadioButton('nametype', 'image')->val('image');
$linkForm->addTextInput('linkname', 'Link name')->attr('placeholder', '(automatic)');
$linkForm->addRadioButton('nametype', $this->getLang('type:automatic title'))->val('automatic')->attr('checked', 'checked');
$linkForm->addRadioButton('nametype', $this->getLang('type:custom title'))->val('custom');
$linkForm->addRadioButton('nametype', $this->getLang('type:image'))->val('image');
$linkForm->addTextInput('linkname', 'Link name')->attr('placeholder', $this->getLang('placeholder:link name'));
$linkForm->addTagOpen('div')->addClass('js-media-wrapper');
$linkForm->addTagClose('div');
$linkForm->addTagClose('fieldset');
Expand All @@ -191,7 +191,7 @@ public function addAddtionalForms(Doku_Event $event)

$linkForm->addFieldsetClose();
$linkForm->addButton('ok-button', 'OK')->attr('type', 'submit');
$linkForm->addButton('cancel-button', 'Cancel')->attr('type', 'button');
$linkForm->addButton('cancel-button', $this->getLang('cancel'))->attr('type', 'button');

echo $linkForm->toHTML();

Expand All @@ -200,59 +200,59 @@ public function addAddtionalForms(Doku_Event $event)
'id' => 'prosemirror-mediaform',
'style' => 'display: none;',
]);
$mediaForm->addFieldsetOpen('Media')->addClass('js-media-fieldset');
$mediaForm->addFieldsetOpen($this->getLang('legend:media'))->addClass('js-media-fieldset');
$mediaForm->addButton('mediamanager', '🖼️')->attrs([
'type' => 'button',
'class' => 'js-open-mediamanager mediaform_mediamanager'
]);
$mediaForm->addTextInput('mediatarget', 'Media')->attrs(
$mediaForm->addTextInput('mediatarget', $this->getLang('media target'))->attrs(
[
'required'=> 'required',
'autofocus' => 'autofocus',
]
);
$mediaForm->addTextInput('mediacaption', 'Caption');
$mediaForm->addTextInput('width', 'Width (px)')->attr('type', 'number');
$mediaForm->addTextInput('height', 'Height (px)')->attr('type', 'number');
$mediaForm->addTextInput('mediacaption', $this->getLang('label:caption'));
$mediaForm->addTextInput('width', $this->getLang('label:width'))->attr('type', 'number');
$mediaForm->addTextInput('height', $this->getLang('label:height'))->attr('type', 'number');

$mediaForm->addTagOpen('div')->addClass('radio-wrapper');
$mediaForm->addTagOpen('fieldset');
$mediaForm->addTagOpen('legend');
$mediaForm->addHTML('Alignment');
$mediaForm->addHTML($this->getLang('legend:alignment'));
$mediaForm->addTagClose('legend');
$mediaForm->addRadioButton('alignment', 'default')->val('')->attr('checked', 'checked');
$mediaForm->addRadioButton('alignment', 'float left')->val('left');
$mediaForm->addRadioButton('alignment', 'center')->val('center');
$mediaForm->addRadioButton('alignment', 'float right')->val('right');
$mediaForm->addRadioButton('alignment', $this->getLang('label:default alignment'))->val('')->attr('checked', 'checked');
$mediaForm->addRadioButton('alignment', $this->getLang('label:float left'))->val('left');
$mediaForm->addRadioButton('alignment', $this->getLang('label:center alignment'))->val('center');
$mediaForm->addRadioButton('alignment', $this->getLang('label:float right'))->val('right');
$mediaForm->addTagClose('fieldset');
$mediaForm->addTagClose('div');

$mediaForm->addTagOpen('div')->addClass('radio-wrapper');
$mediaForm->addTagOpen('fieldset');
$mediaForm->addTagOpen('legend');
$mediaForm->addHTML('Linking');
$mediaForm->addHTML($this->getLang('legend:linking'));
$mediaForm->addTagClose('legend');
$mediaForm->addRadioButton('linking', 'default')->val('details')->attr('checked', 'checked');
$mediaForm->addRadioButton('linking', 'direct')->val('direct');
$mediaForm->addRadioButton('linking', 'nolink')->val('nolink');
$mediaForm->addRadioButton('linking', 'linkonly')->val('linkonly');
$mediaForm->addRadioButton('linking', $this->getLang('label:default linking'))->val('details')->attr('checked', 'checked');
$mediaForm->addRadioButton('linking', $this->getLang('label:direct linking'))->val('direct');
$mediaForm->addRadioButton('linking', $this->getLang('label:nolink'))->val('nolink');
$mediaForm->addRadioButton('linking', $this->getLang('label:linkonly'))->val('linkonly');
$mediaForm->addTagClose('fieldset');
$mediaForm->addTagClose('div');

$mediaForm->addTagOpen('div')->addClass('radio-wrapper');
$mediaForm->addTagOpen('fieldset');
$mediaForm->addTagOpen('legend');
$mediaForm->addHTML('Caching');
$mediaForm->addHTML($this->getLang('legend:caching'));
$mediaForm->addTagClose('legend');
$mediaForm->addRadioButton('caching', 'default')->val('')->attr('checked', 'checked');
$mediaForm->addRadioButton('caching', 'recache')->val('recache');
$mediaForm->addRadioButton('caching', 'nocache')->val('nocache');
$mediaForm->addRadioButton('caching', $this->getLang('label:default caching'))->val('')->attr('checked', 'checked');
$mediaForm->addRadioButton('caching', $this->getLang('label:recache'))->val('recache');
$mediaForm->addRadioButton('caching', $this->getLang('label:nocache'))->val('nocache');
$mediaForm->addTagClose('fieldset');
$mediaForm->addTagClose('div');

$mediaForm->addFieldsetClose();
$mediaForm->addButton('ok-button', 'OK')->attr('type', 'submit');
$mediaForm->addButton('cancel-button', 'Cancel')->attr('type', 'button');
$mediaForm->addButton('cancel-button', $this->getLang('cancel'))->attr('type', 'button');

// dynamic image hack? https://www.dokuwiki.org/images#dynamic_images

Expand Down
83 changes: 83 additions & 0 deletions lang/de/lang.php
@@ -0,0 +1,83 @@
<?php
/**
* English language file for prosemirror plugin
*
* @author Andreas Gohr <gohr@cosmocode.de>
*/

// custom language strings for the plugin
$lang['switch_editors'] = 'Schalte WYSIWYG-Editor um';

$lang['link target'] = 'Linkziel';
$lang['type:wiki page'] = 'Eine Seite in diesem Wiki';
$lang['type:interwiki'] = 'Ein Interwiki-Link';
$lang['type:email'] = 'Email Addresse';
$lang['type:external'] = 'Externe Seite';
$lang['type:other'] = 'Sonstiger Link';
$lang['type:automatic title'] = 'Automatischer Titel';
$lang['type:custom title'] = 'Benutzerdefinierter Titel';
$lang['type:image'] = 'Bild als Titel nutzen';

$lang['placeholder:link name'] = '(automatisch)';

$lang['legend:media'] = 'Bild';
$lang['legend:alignment'] = 'Ausrichtung';
$lang['legend:linking'] = 'Verlinkung';
$lang['legend:caching'] = 'Caching';
$lang['media target'] = 'Bilddatei';
$lang['label:caption'] = 'Titel';
$lang['label:width'] = 'Breite (px)';
$lang['label:height'] = 'Höhe (px)';
$lang['label:default alignment'] = 'Standard';
$lang['label:float left'] = 'Links umfließend';
$lang['label:center alignment'] = 'Zentriert';
$lang['label:float right'] = 'Rechtsumfließend';
$lang['label:default linking'] = 'Detailseite';
$lang['label:direct linking'] = 'Bilddatei direkt';
$lang['label:nolink'] = 'Kein Link';
$lang['label:linkonly'] = 'nur Link';
$lang['label:default caching'] = 'Standard Caching Verhalten';
$lang['label:recache'] = 'Recache';
$lang['label:nocache'] = 'Cache immer überprüfen (langsam)';

$lang['cancel'] = 'Abbrechen';

$lang['js']['cancel'] = $lang['cancel'];

$lang['js']['linkConfig'] = 'Link-Einstellungen';
$lang['js']['mediaConfig'] = 'Bildeinstellungen';
$lang['js']['rssConfig'] = 'RSS-Feed konfigurieren';
$lang['js']['footnoteViewTitle'] = 'Fußnote bearbeiten';
$lang['js']['placeholder:page'] = 'namensraum:seite';

$lang['js']['label:blockquote'] = 'Blockzitat';
$lang['js']['label:bulletList'] = 'Aufzählungsliste';
$lang['js']['label:code'] = 'Code Block';
$lang['js']['label:footnote'] = 'Fußnote hinzufügen';
$lang['js']['label:headings'] = 'Überschriften';
$lang['js']['label:heading'] = 'Überschrift %s';
$lang['js']['label:image'] = 'Bild einfügen';
$lang['js']['label:liftLI'] = 'Listenelement einrücken';
$lang['js']['label:link'] = 'Link einfügen';
$lang['js']['label:orderedList'] = 'geordnete Liste';
$lang['js']['label:paragraph'] = 'Absatz';
$lang['js']['label:pluginBlock'] = 'Plugin-Block einfügen';
$lang['js']['label:rss'] = 'Neuen RSS-Feed einfügen';
$lang['js']['label:sinkListItem'] = 'Einrückung des Listenelements entfernen';
$lang['js']['label:strong'] = 'fett';
$lang['js']['label:em'] = 'kursiv';
$lang['js']['label:underline'] = 'unterstrichen';
$lang['js']['label:superscript'] = 'hoch stellen';
$lang['js']['label:subscript'] = 'tief stellen';
$lang['js']['label:deleted'] = 'durchstreichen';
$lang['js']['label:monospaced'] = 'feste Zeichenbreite';

$lang['js']['label:rss url'] = 'URL des RSS-Feeds';
$lang['js']['label:rss nOfItems'] = 'Maximale Anzahl an Einträgen';
$lang['js']['label:rss reverse'] = 'Neueste Einträge am Beginn anzeigen';
$lang['js']['label:rss author'] = 'AuthorIn anzeigen';
$lang['js']['label:rss date'] = 'Zeige das Datum des Eintrages';
$lang['js']['label:rss details'] = 'Zeige die Beschreibung des Eintrages';
$lang['js']['label:rss refresh'] = 'Abfragerhythmus';

$lang['js']['code_block_hint'] = '💡 Zum Verlassen drücken Sie STRG+Enter';
80 changes: 74 additions & 6 deletions lang/en/lang.php
Expand Up @@ -5,11 +5,79 @@
* @author Andreas Gohr <gohr@cosmocode.de>
*/

// menu entry for admin plugins
// $lang['menu'] = 'Your menu entry';

// custom language strings for the plugin
$lang['switch_editors'] = 'Toggle WYSIWYG editor';
$lang['js']['code_block_hint'] = '💡 Press CTRL+Enter to exit';
$lang['switch_editors'] = 'Toggle WYSIWYG editor';

$lang['link target'] = 'Link target';
$lang['type:wiki page'] = 'A page in this wiki';
$lang['type:interwiki'] = 'An interwiki link';
$lang['type:email'] = 'An email address';
$lang['type:external'] = 'An link to an external page';
$lang['type:other'] = 'Other';
$lang['type:automatic title'] = 'Automatic title';
$lang['type:custom title'] = 'Custom title';
$lang['type:image'] = 'Use an image as title';

$lang['placeholder:link name'] = '(automatic)';

$lang['legend:media'] = 'Media';
$lang['legend:alignment'] = 'Alignment';
$lang['legend:linking'] = 'Linking';
$lang['legend:caching'] = 'Caching';
$lang['media target'] = 'Image file';
$lang['label:caption'] = 'Caption';
$lang['label:width'] = 'Width (px)';
$lang['label:height'] = 'Height (px)';
$lang['label:default alignment'] = 'Default';
$lang['label:float left'] = 'Left';
$lang['label:center alignment'] = 'Center';
$lang['label:float right'] = 'Right';
$lang['label:default linking'] = 'Default';
$lang['label:direct linking'] = 'Direct';
$lang['label:nolink'] = 'No link';
$lang['label:linkonly'] = 'Link only';
$lang['label:default caching'] = 'Default';
$lang['label:recache'] = 'Recache';
$lang['label:nocache'] = 'Nocache';

$lang['cancel'] = 'Cancel';

$lang['js']['cancel'] = $lang['cancel'];

$lang['js']['linkConfig'] = 'Link Configuration';
$lang['js']['mediaConfig'] = 'Image Configuration';
$lang['js']['rssConfig'] = 'RSS-Feed Configuration';
$lang['js']['footnoteViewTitle'] = 'Edit footnote';
$lang['js']['placeholder:page'] = 'namespace:page';

$lang['js']['label:blockquote'] = 'Blockquote';
$lang['js']['label:bulletList'] = 'Wrap in bullet list';
$lang['js']['label:code'] = 'Code Block';
$lang['js']['label:footnote'] = 'Add a footnote';
$lang['js']['label:headings'] = 'Headings';
$lang['js']['label:heading'] = 'Heading %s';
$lang['js']['label:image'] = 'Insert Image';
$lang['js']['label:liftLI'] = 'Lift list item';
$lang['js']['label:link'] = 'Insert Link';
$lang['js']['label:orderedList'] = 'Wrap in ordered list';
$lang['js']['label:paragraph'] = 'Paragraph';
$lang['js']['label:pluginBlock'] = 'Plugin block';
$lang['js']['label:rss'] = 'Add new RSS feed';
$lang['js']['label:sinkListItem'] = 'Sink list item';
$lang['js']['label:strong'] = 'strong';
$lang['js']['label:em'] = 'italic';
$lang['js']['label:underline'] = 'underline';
$lang['js']['label:superscript'] = 'superscript';
$lang['js']['label:subscript'] = 'subscript';
$lang['js']['label:deleted'] = 'strike through';
$lang['js']['label:monospaced'] = 'monospaced';

$lang['js']['label:rss url'] = 'URL of the RSS feed';
$lang['js']['label:rss nOfItems'] = 'Maximum number of items to show';
$lang['js']['label:rss reverse'] = 'Display the last items in the feed first';
$lang['js']['label:rss author'] = 'Show item authors names';
$lang['js']['label:rss date'] = 'Show item dates';
$lang['js']['label:rss details'] = 'Show the item description';
$lang['js']['label:rss refresh'] = 'Refresh period';

//Setup VIM: ex: et ts=4 :
$lang['js']['code_block_hint'] = '💡 Press CTRL+Enter to exit';
2 changes: 1 addition & 1 deletion script/nodeviews/FootnoteView.js
Expand Up @@ -40,7 +40,7 @@ class FootnoteView extends AbstractNodeView {
jQuery(this.tooltip).dialog({
minWidth: 1100,
minHeight: 550,
title: 'edit footnote',
title: LANG.plugins.prosemirror.footnoteViewTitle,
modal: true,
appendTo: '.dokuwiki',
close: this.dispatchOuter.bind(this),
Expand Down
2 changes: 1 addition & 1 deletion script/nodeviews/KeyValueForm.js
Expand Up @@ -20,7 +20,7 @@ class KeyValueForm extends NodeForm {

this.$form.append(jQuery('<button>', {
type: 'submit',
}).text('Submit'));
}).text('OK'));

this.$form.find('[name="cancel-button"]').on('click', this.hide.bind(this));
}
Expand Down
4 changes: 2 additions & 2 deletions script/nodeviews/LinkForm.js
Expand Up @@ -5,7 +5,7 @@ class LinkForm extends CustomForm {
constructor() {
super('prosemirror-linkform');

this.name = 'Link Configuration';
this.name = LANG.plugins.prosemirror.linkConfig;

if (jQuery('#prosemirror-linkform').length) {
this.initializeLinkForm();
Expand Down Expand Up @@ -159,7 +159,7 @@ class LinkForm extends CustomForm {
$linkWizButton.show();
$linkTargetInput
.attr('type', 'text')
.prop('placeholder', 'namespace:page');
.prop('placeholder', LANG.plugins.prosemirror['placeholder:page']);
break;
case 'interwikilink':
this.$form.find('[name="iwshortcut"]').closest('label').show();
Expand Down
2 changes: 1 addition & 1 deletion script/nodeviews/MediaForm.js
Expand Up @@ -9,7 +9,7 @@ class MediaForm extends CustomForm {
constructor(id = 'prosemirror-mediaform') {
super(id);

this.name = 'Image Configuration';
this.name = LANG.plugins.prosemirror.mediaConfig;

this.$form.find('.js-open-mediamanager').on('click', MediaForm.openMediaManager);
window.pmMediaSelect = this.mediaSelect.bind(this);
Expand Down
1 change: 1 addition & 0 deletions script/nodeviews/NodeForm.js
Expand Up @@ -8,6 +8,7 @@ class NodeForm {
this.hasBeenOpened = true;
this.$form.dialog({
title: this.name,
closeText: LANG.plugins.prosemirror.cancel,
width: 800,
appendTo: '.dokuwiki',
modal: true,
Expand Down

0 comments on commit 3d5c820

Please sign in to comment.