Skip to content

Commit

Permalink
Merge pull request #41 from xima-media/german-translation
Browse files Browse the repository at this point in the history
Add German translation
  • Loading branch information
maikschneider authored Sep 18, 2024
2 parents ed89870 + 164db89 commit d81071a
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 28 deletions.
1 change: 1 addition & 0 deletions Classes/Controller/BackendController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function __construct(
) {
$this->moduleTemplateFactory = $moduleTemplateFactory;
$this->pageRenderer = $pageRenderer;
$this->pageRenderer->addInlineLanguageLabelFile('EXT:xima_typo3_mailcatcher/Resources/Private/Language/locallang.xlf', 'js');
$this->pageRenderer->addCssFile('EXT:xima_typo3_mailcatcher/Resources/Public/Css/backend.css');
}

Expand Down
87 changes: 87 additions & 0 deletions Resources/Private/Language/de.locallang.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-29T07:42:06Z">
<body>
<trans-unit id="js.delete.button">
<source>Delete Messages</source>
<target>Alle Nachrichten löschen</target>
</trans-unit>
<trans-unit id="js.delete.message">
<source>Are you sure, you want to delete all messages?</source>
<target>Bist du sicher, dass du alle Nachrichten löschen möchtest?</target>
</trans-unit>
<trans-unit id="js.delete.yes">
<source>Yes, delete</source>
<target>Ja, löschen</target>
</trans-unit>
<trans-unit id="js.delete.no">
<source>No, abort</source>
<target>Nein, abbrechen</target>
</trans-unit>
<trans-unit id="js.success.headline">
<source>Success</source>
<target>Erfolgreich</target>
</trans-unit>
<trans-unit id="js.success.text">
<source>All messages have been deleted</source>
<target>Alle Nachrichten wurden gelöscht</target>
</trans-unit>
<trans-unit id="js.success.text2">
<source>Message has been deleted</source>
<target>Nachricht wurde gelöscht</target>
</trans-unit>
<trans-unit id="js.error.headline">
<source>Error</source>
<target>Fehler</target>
</trans-unit>
<trans-unit id="js.error.text">
<source>Could not delete messages</source>
<target>Nachrichten konnten nicht gelöscht werden</target>
</trans-unit>
<trans-unit id="js.error.text2">
<source>Could not delete message</source>
<target>Nachricht konnte nicht gelöscht werden</target>
</trans-unit>
<trans-unit id="js.error.text3">
<source>Could not load message</source>
<target>Nachricht konnte nicht geladen werden</target>
</trans-unit>
<trans-unit id="empty.title">
<source>No messages</source>
<target>Keine Nachrichten</target>
</trans-unit>
<trans-unit id="empty.text">
<source>There are currently no messages to display</source>
<target>Aktuell gibt es keine Nachrichten zum Anzeigen</target>
</trans-unit>
<trans-unit id="mailLog">
<source>Mail Log</source>
<target>Mail Log</target>
</trans-unit>
<trans-unit id="inbox">
<source>Inbox</source>
<target>Eingang</target>
</trans-unit>
<trans-unit id="button.delete.all">
<source>Delete all messages</source>
<target>Alle löschen</target>
</trans-unit>
<trans-unit id="to">
<source>To</source>
<target>An</target>
</trans-unit>
<trans-unit id="date">
<source>Date</source>
<target>Datum</target>
</trans-unit>
<trans-unit id="button.plain">
<source>Plain</source>
<target>Text</target>
</trans-unit>
<trans-unit id="button.files">
<source>Files</source>
<target>Anhänge</target>
</trans-unit>
</body>
</file>
</xliff>
67 changes: 67 additions & 0 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="messages" date="2019-04-29T07:42:06Z">
<body>
<trans-unit id="js.delete.button">
<source>Delete Messages</source>
</trans-unit>
<trans-unit id="js.delete.message">
<source>Are you sure, you want to delete all messages?</source>
</trans-unit>
<trans-unit id="js.delete.yes">
<source>Yes, delete</source>
</trans-unit>
<trans-unit id="js.delete.no">
<source>No, abort</source>
</trans-unit>
<trans-unit id="js.success.headline">
<source>Success</source>
</trans-unit>
<trans-unit id="js.success.text">
<source>All messages have been deleted</source>
</trans-unit>
<trans-unit id="js.success.text2">
<source>Message has been deleted</source>
</trans-unit>
<trans-unit id="js.error.headline">
<source>Error</source>
</trans-unit>
<trans-unit id="js.error.text">
<source>Could not delete messages</source>
</trans-unit>
<trans-unit id="js.error.text2">
<source>Could not delete message</source>
</trans-unit>
<trans-unit id="js.error.text3">
<source>Could not load message</source>
</trans-unit>
<trans-unit id="empty.title">
<source>No messages</source>
</trans-unit>
<trans-unit id="empty.text">
<source>There are currently no messages to display</source>
</trans-unit>
<trans-unit id="mailLog">
<source>Mail Log</source>
</trans-unit>
<trans-unit id="inbox">
<source>Inbox</source>
</trans-unit>
<trans-unit id="button.delete.all">
<source>Delete all messages</source>
</trans-unit>
<trans-unit id="to">
<source>To</source>
</trans-unit>
<trans-unit id="date">
<source>Date</source>
</trans-unit>
<trans-unit id="button.plain">
<source>Plain</source>
</trans-unit>
<trans-unit id="button.files">
<source>Files</source>
</trans-unit>
</body>
</file>
</xliff>
17 changes: 8 additions & 9 deletions Resources/Private/Templates/Backend/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
<div class="row justify-content-md-center">
<div class="col"></div>
<div class="col col-lg-10">
<h1>Mail Log</h1>
<h1>{f:translate(key: 'mailLog')}</h1>
</div>
</div>
<div class="row justify-content-md-center">
<div class="col">
<ul class="list-group">
<li class="list-group-item">Inbox (<span class="message-count">{mails->f:count()}</span>)</li>
<li class="list-group-item">{f:translate(key: 'inbox')} (<span class="message-count">{mails->f:count()}</span>)</li>
</ul>

<div class="text-center">
<button type="button" class="btn btn-danger" id="delete-all-messages">
<core:icon identifier="actions-delete" size="small" />
Delete all messages
{f:translate(key: 'button.delete.all')}
</button>
</div>

</div>
<div class="col col-lg-10">

<div class="infobox hidden" data-message-count="{mails->f:count()}">
<f:be.infobox title="No messages" state="-1">There are currently no messages to display</f:be.infobox>
<f:be.infobox title="{f:translate(key: 'empty.title')}" state="-1">{f:translate(key: 'empty.text')}</f:be.infobox>
</div>

<f:if condition="{mails}">
Expand Down Expand Up @@ -51,7 +51,6 @@ <h1>Mail Log</h1>
<div class="btn-group btn-group-sm" role="group">
<button type="button" class="btn btn-default" title="Delete mail" data-delete>
<core:icon identifier="actions-delete" size="small" />
</span>
</button>
</div>
</div>
Expand All @@ -62,19 +61,19 @@ <h1>Mail Log</h1>
<div class="tab-header">
<div class="row">
<div class="col">
<span><strong>To:</strong> {mail.displayToAddress}<br />
<span><strong>{f:translate(key: 'to')}:</strong> {mail.displayToAddress}<br />
<f:if condition="{mail.displayCcRecipients}"><strong>Cc:</strong>
{mail.displayCcRecipients}<br /></f:if>
<f:if condition="{mail.displayBccRecipients}"><strong>Bcc:</strong>
{mail.displayBccRecipients}<br /></f:if>
<strong>Date:</strong>
<strong>{f:translate(key: 'date')}:</strong>
<f:format.date format="H:i, d.m.Y">{mail.date}</f:format.date>
</span>
</div>
<div class="col d-flex justify-content-end align-items-center">
<div class="btn-group content-type-switches">
<f:if condition="{mail.bodyPlain}">
<a class="btn btn-primary" data-content-type="plain" data-m-id="{i.cycle}">Plain
<a class="btn btn-primary" data-content-type="plain" data-m-id="{i.cycle}">{f:translate(key: 'button.plain')}
</a>
</f:if>
<f:if condition="{mail.bodyHtml}">
Expand All @@ -84,7 +83,7 @@ <h1>Mail Log</h1>
</a>
</f:if>
<f:if condition="{mail.attachments->f:count()}">
<a class="btn btn-default" data-content-type="files" data-m-id="{i.cycle}">Files
<a class="btn btn-default" data-content-type="files" data-m-id="{i.cycle}">{f:translate(key: 'button.files')}
</a>
</f:if>
</div>
Expand Down
18 changes: 8 additions & 10 deletions Resources/Private/Templates/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@
<div class="row justify-content-md-center">
<div class="col"></div>
<div class="col col-lg-10">
<h1>Mail Log</h1>
<h1>{f:translate(key: 'mailLog')}</h1>
</div>
</div>
<div class="row justify-content-md-center">
<div class="col">
<ul class="list-group">
<li class="list-group-item">Inbox
<li class="list-group-item">{f:translate(key: 'inbox')}
(<span class="message-count">{mails->f:count()}</span>)
</li>
</ul>

<div class="text-center">
<button type="button" class="btn btn-danger" id="delete-all-messages">
<core:icon identifier="actions-delete" size="small" />
Delete all messages
{f:translate(key: 'button.delete.all')}
</button>
</div>

</div>
<div class="col col-lg-10">

<div class="infobox hidden" data-message-count="{mails->f:count()}">
<f:be.infobox title="No messages" state="-1">There are currently no messages to display</f:be.infobox>
<f:be.infobox title="{f:translate(key: 'empty.title')}" state="-1">{f:translate(key: 'empty.text')}</f:be.infobox>
</div>

<f:if condition="{mails}">
Expand Down Expand Up @@ -59,7 +59,6 @@ <h1>Mail Log</h1>
<div class="btn-group btn-group-sm" role="group">
<button type="button" class="btn btn-default" title="Delete mail" data-delete>
<core:icon identifier="actions-delete" size="small" />
</span>
</button>
</div>
</div>
Expand All @@ -70,19 +69,19 @@ <h1>Mail Log</h1>
<div class="tab-header">
<div class="row">
<div class="col">
<span><strong>To:</strong> {mail.displayToAddress}<br />
<span><strong>{f:translate(key: 'to')}:</strong> {mail.displayToAddress}<br />
<f:if condition="{mail.displayCcRecipients}"><strong>Cc:</strong>
{mail.displayCcRecipients}<br /></f:if>
<f:if condition="{mail.displayBccRecipients}"><strong>Bcc:</strong>
{mail.displayBccRecipients}<br /></f:if>
<strong>Date:</strong>
<strong>{f:translate(key: 'date')}:</strong>
<f:format.date format="H:i, d.m.Y">{mail.date}</f:format.date>
</span>
</div>
<div class="col d-flex justify-content-end align-items-center">
<div class="btn-group content-type-switches">
<f:if condition="{mail.bodyPlain}">
<a class="btn btn-primary" data-content-type="plain" data-m-id="{i.cycle}">Plain
<a class="btn btn-primary" data-content-type="plain" data-m-id="{i.cycle}">{f:translate(key: 'button.plain')}
</a>
</f:if>
<f:if condition="{mail.bodyHtml}">
Expand All @@ -92,7 +91,7 @@ <h1>Mail Log</h1>
</a>
</f:if>
<f:if condition="{mail.attachments->f:count()}">
<a class="btn btn-default" data-content-type="files" data-m-id="{i.cycle}">Files
<a class="btn btn-default" data-content-type="files" data-m-id="{i.cycle}">{f:translate(key: 'button.files')}
</a>
</f:if>
</div>
Expand Down Expand Up @@ -134,7 +133,6 @@ <h1>Mail Log</h1>
</div>
</div>
</div>
</div>

<style>
.tab-header {
Expand Down
15 changes: 8 additions & 7 deletions Resources/Private/TypeScript/MailCatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ class MailCatcher {
e.preventDefault();
const self = this;

Modal.confirm('Delete Messages', 'Are you sure, you want to delete all messages?', Severity.warning, [
Modal.confirm(TYPO3.lang['js.delete.button'], TYPO3.lang['js.delete.message'], Severity.warning, [
{
text: 'Yes, delete',
text: TYPO3.lang['js.delete.yes'],
btnClass: 'btn-danger',
trigger: function () {
self.deleteAllMessages();
Modal.dismiss();
}
},
{
text: 'No, abort',
text: TYPO3.lang['js.delete.no'],
btnClass: 'btn-default',
active: true,
trigger: function () {
Expand All @@ -61,10 +61,10 @@ class MailCatcher {
if (resolved.success) {
$panel.remove();
self.refreshMessageCount();
top.TYPO3.Notification.success('Success', 'All messages have been deleted', 3);
top.TYPO3.Notification.success(TYPO3.lang['js.success.headline'], TYPO3.lang['js.success.text'], 3);
return;
}
top.TYPO3.Notification.error('Error', 'Could not delete messages', 3);
top.TYPO3.Notification.error(TYPO3.lang['js.error.headline'], TYPO3.lang['js.error.text'], 3);
});
}

Expand All @@ -88,9 +88,10 @@ class MailCatcher {
if (resolved.success) {
$panel.remove();
self.refreshMessageCount();
top.TYPO3.Notification.success(TYPO3.lang['js.success.headline'], TYPO3.lang['js.success.text2'], 3);
return;
}
top.TYPO3.Notification.error('Error', 'Could not delete message', 3);
top.TYPO3.Notification.error(TYPO3.lang['js.error.headline'], TYPO3.lang['js.error.text2'], 3);
});
}

Expand Down Expand Up @@ -130,7 +131,7 @@ class MailCatcher {
$('.panel[data-message-file="' + messageFile + '"]').attr('data-html-loaded', 'true');
})
.catch(() => {
$('.panel[data-message-file="' + messageFile + '"] .form-section[data-content-type="html"]').html('<div class="callout callout-danger">Could not load message</div>');
$('.panel[data-message-file="' + messageFile + '"] .form-section[data-content-type="html"]').html('<div class="callout callout-danger">' + TYPO3.lang['js.error.text3'] + '</div>');
})
}
}
Expand Down
Loading

0 comments on commit d81071a

Please sign in to comment.