Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
- updated Dutch translation
- minor change in wording
- split VAT# in label and number
  • Loading branch information
hartenthaler committed Nov 28, 2022
1 parent e91990b commit 50dcf4a
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 60 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

This [webtrees](https://www.webtrees.net) module creates an imprint notice in the footer of the web page.

There is a German [manual page](https://wiki.genealogy.net/Webtrees_Handbuch/Anleitung_f%C3%BCr_Webmaster/Erweiterungsmodule/Impressum) available, too.

<a name="Contents"></a>
## Contents

Expand All @@ -29,15 +31,19 @@ This Readme contains the following main sections

This module adds an imprint notice to all pages of a webtrees site.

Such an imprint is maybe necessary, depending on your local law. In Germany there
is a need based on two laws: xxxx
Such an imprint is maybe necessary, depending on your local law.

There is maybe a need to present on your website an "Imprint" (depending on the character of your site)
* Germany: [§5 Telemediengesetz (TMG)](https://dejure.org/gesetze/TMG/5.html)
* Austria: § 5 Abs. 1 E-Commerce-Gesetz (ECG)
* Switzerland: Art. 3 des Bundesgesetzes gegen den unlauteren Wettbewerb (UWG)

The webtrees admin can define the following data fields in the control panel for the responsible person
* name
* VAT ID number or other registration number
* address
* phone and fax numbers
* eMail address
* VAT ID number or other registration number

<a name="screenshots"></a>
## Screenshots
Expand Down Expand Up @@ -90,7 +96,7 @@ Discussion on translating can be done by creating an [issue](https://github.com/

Updated translations will be included in the next release of this module.

There are now, beside English and German, no other translations available.
There are now, beside English, Dutch (by TheDutchJewel) and German, no other translations available.

<a name="support"></a>
## Support
Expand Down
2 changes: 1 addition & 1 deletion latest-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.8.0
2.1.8.1
62 changes: 42 additions & 20 deletions module.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,23 @@
*/

/*
* tbd
* tbd for next release
* ==============================================================
* Problem mit Option simpleEmail beheben
*
* tbd later on
* ==============================================================
* Strings automatisch für po extrahieren
* Woher bekommt man den join-Link für neue Übersetzer auf https://poeditor.com?
* Muss man Sprachen vorab bereits anlegen? pot verwenden?
* Abgleich mit anderen Impressums-Seiten
* Problem mit Option simpleEmail beheben
* README.md aktualisieren mit Hinweis auf Übersetzung und Hinweis auf die Rechtslage und Screenshot des erzeugten Impressums
* Initialisieren bei Erstverwendung mit erstem Admin (Name und E-Mail)
* Gravatar weiter testen
* E-Mail-Funktion: check if there is one @ inside emailAddress and no blanks; if address is not correct: use it as simple eMail
* E-Mail-Funktion: korrekten site name einfügen
* Labels in page.html als bereits übersetzte Parameter übergeben
* README.md aktualisieren mit korrektem Link für neue Übersetzer (join) und
* Screenshot des erzeugten Impressums
* Initialisieren bei Erstverwendung mit erstem Admin (Name und E-Mail)
* Gravatar weiter testen
* Dokumentation in Deutsch für webtrees-Handbuch erstellen
* Refactoring
*/

Expand Down Expand Up @@ -76,7 +83,7 @@
public const CUSTOM_AUTHOR = 'Hermann Hartenthaler';
public const CUSTOM_GITHUB_USER = 'hartenthaler';
public const CUSTOM_WEBSITE = 'https://github.com/' . self::CUSTOM_GITHUB_USER . '/' . self::CUSTOM_MODULE . '/';
public const CUSTOM_VERSION = '2.1.8.0';
public const CUSTOM_VERSION = '2.1.8.1';
public const CUSTOM_LAST = 'https://raw.githubusercontent.com/' . self::CUSTOM_GITHUB_USER . '/' .
self::CUSTOM_MODULE . '/main/latest-version.txt';

Expand Down Expand Up @@ -107,13 +114,14 @@ private function listOfPreferences(): array
'responsibleFirst',
'responsibleSurname',
'responsibleSex',
'vatNumber',
'street',
'city',
'phone',
'fax',
'email',
'simpleEmail',
'vatNumberLabel',
'vatNumber',
];
}

Expand Down Expand Up @@ -317,15 +325,19 @@ public function getPageAction(ServerRequestInterface $request): ResponseInterfac
'title' => $this->title(),
'tree' => Validator::attributes($request)->tree(),
'imprintHead1' => I18N::translate('Responsible person'),
'imprintHead2' => I18N::translate('This website is operated by the following responsible person:'),
'imprintHead2' => I18N::translate('This website is operated by:'),
'responsibleName' => $this->responsibleName(),
'vatNumber' => $this->vatNumber(),
'street' => $this->street(),
'city' => $this->city(),
'phoneLabel' => I18N::translate('Phone'),
'phone' => $this->phone(),
'faxLabel' => I18N::translate('Fax'),
'fax' => $this->fax(),
'emailLabel' => I18N::translate('eMail'),
'email' => $this->email(),
'simpleEmail' => $this->simpleEmail(),
'vatNumberLabel' => $this->vatNumberLabel(),
'vatNumber' => $this->vatNumber(),
'administrators' => $administrators, // tbd
'contactLinks' => $contactLinks, // tbd
'img' => $this->get_gravatar('hartenthaler@gmail.com'), // tbd
Expand Down Expand Up @@ -373,16 +385,6 @@ private function responsibleSex(): string
return $this->getPreference('responsibleSex', 'M');
}

/**
* VAT number or other registration number
*
* @return string
*/
private function vatNumber(): string
{
return $this->getPreference('vatNumber', '');
}

/**
* street name and house number of responsible person
*
Expand Down Expand Up @@ -483,6 +485,26 @@ private function simpleEmail(): bool
return ($this->getPreference('simpleEmail', '0') == '0');
}

/**
* Label for VAT number or other registration number
*
* @return string
*/
private function vatNumberLabel(): string
{
return $this->getPreference('vatNumberLabel', '');
}

/**
* VAT number or other registration number
*
* @return string
*/
private function vatNumber(): string
{
return $this->getPreference('vatNumber', '');
}

/**
* Create a contact link for a user.
*
Expand Down
Binary file modified resources/lang/de.mo
Binary file not shown.
30 changes: 24 additions & 6 deletions resources/lang/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ msgstr "Vorname(n)"
msgid "Surname(s)"
msgstr "Nachname(n)"

msgid "Sex of responsible person"
msgstr "Geschlecht der verantwortlichen Person"
msgid "Sex"
msgstr "Geschlecht"

msgid "male"
msgstr "männlich"
Expand All @@ -38,8 +38,11 @@ msgstr "weiblich"
msgid "Registration data"
msgstr "Registrierungsdaten"

msgid "VAT ID No. or other registration number (enter label and value)"
msgstr "Umsatzsteuer-Identifikationsnummer oder andere Registrierungsnummer (Beschriftung und Wert eingeben)"
msgid "Label like VAT ID No. or other registration number label"
msgstr "Bezeichnung wie \"Umsatzsteuer-Identifikationsnummer\" oder andere Registrierungsnummer-Bezeichnung"

msgid "VAT ID No. or other registration number"
msgstr "Umsatzsteuer-Identifikationsnummer oder andere Registrierungsnummer"

msgid "Communication data"
msgstr "Kommunikationsdaten"
Expand All @@ -59,8 +62,23 @@ msgstr "Telefaxnummer inkl. Landesvorwahl, z.B. \"+49 30 654321\""
msgid "eMail address"
msgstr "E-Mail-Adresse"

msgid "eMail"
msgstr "E-Mail"

msgid "Should a simple eMail link be used (otherwise subject and body of eMail are generated, too)?"
msgstr "Soll ein einfacher Verweis auf die E-Mail-Adresse verwendet werden (andernfalls werden der Betreff und der Inhalt der E-Mail mit erzeugt)?"

msgid "This website is operated by the following responsible person:"
msgstr "Diese Website wird von der folgenden, verantwortlichen Person betrieben:"
msgid "This website is operated by:"
msgstr "Diese Website wird betrieben von:"

msgid "message via imprint of site %s"
msgstr "Nachricht über das Impressum der Website %s"

msgid "Dear Mr. %s"
msgstr "Sehr geehrter Herr %s"

msgid "Dear Mrs. %s"
msgstr "Sehr geehrte Frau %s"

msgid "Dear %s"
msgstr "Sehr geehrte/r %s"
Binary file modified resources/lang/nl.mo
Binary file not shown.
24 changes: 21 additions & 3 deletions resources/lang/nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ msgstr "vrouw"
msgid "Registration data"
msgstr "Registratiegegevens"

msgid "VAT ID No. or other registration number (enter label and value)"
msgstr "Btw-nummer of ander registratienummer (label en waarde invullen)"
msgid "Label like VAT ID No. or other registration number label"
msgstr "Label xxx \"Btw-nummer\" of ander registratienummer label"

msgid "VAT ID No. or other registration number"
msgstr "Btw-nummer of ander registratienummer"

msgid "Communication data"
msgstr "Contactgegevens"
Expand All @@ -59,8 +62,23 @@ msgstr "Faxnummer inclusief landnummer, bijvoorbeeld \"+31 12 3456789\"."
msgid "eMail address"
msgstr "E-mailadres"

msgid "eMail"
msgstr "E-mail"

msgid "Should a simple eMail link be used (otherwise subject and body of eMail are generated, too)?"
msgstr "Eenvoudige e-maillink gebruiken (anders wordt ook het onderwerp en de inhoud van de e-mail gegenereerd)?"

msgid "This website is operated by the following responsible person:"
msgid "This website is operated by:"
msgstr "Deze website wordt beheerd door:"

msgid "message via imprint of site %s"
msgstr "xxx Nachricht über das Impressum der Website %s"

msgid "Dear Mr. %s"
msgstr "xxx Sehr geehrter Herr %s"

msgid "Dear Mrs. %s"
msgstr "xxx Sehr geehrte Frau %s"

msgid "Dear %s"
msgstr "xxx Sehr geehrte/r %s"
25 changes: 14 additions & 11 deletions resources/views/page.phtml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<?php

use Fisharebest\Webtrees\I18N;

/**
* @var string $title title of this module
* @var Fisharebest\Webtrees\Tree $tree
* @var string $imprintHead1 main title of this page
* @var string $imprintHead2 subtitle of this page
* @var string $responsibleName name of responsible person
* @var string $vatNumber
* @var string $street
* @var string $city
* @var string $phoneLabel
* @var string $phone
* @var string $faxLabel
* @var string $fax
* @var string $emailLabel
* @var string $email
* @var string $vatNumberLabel
* @var string $vatNumber
* @var array $contactLinks
* @var string $img complete html image link for gravatar
*/
Expand All @@ -36,28 +38,29 @@ use Fisharebest\Webtrees\I18N;
<?= $city ?></td>
<?php endif ?>
</tr>
<?php if ($vatNumber <> ''): ?>
<tr>
<td><?= $vatNumber ?></td>
</tr>
<?php endif ?>
<?php if ($phone <> ''): ?>
<tr>
<td><?= I18N::translate('Phone') ?>:</td>
<td><?= $phoneLabel ?>:</td>
<td><?= $phone ?></td>
</tr>
<?php endif ?>
<?php if ($fax <> ''): ?>
<tr>
<td><?= I18N::translate('Fax') ?>:</td>
<td><?= $faxLabel ?>:</td>
<td><?= $fax ?></td>
</tr>
<?php endif ?>
<?php if ($email <> ''): ?>
<tr>
<td><?= I18N::translate('eMail') ?>:</td>
<td><?= $emailLabel ?>:</td>
<td><?= $email ?></td>
</tr>
<?php endif ?>
<?php if ($vatNumberLabel <> '' && $vatNumber <> ''): ?>
<tr>
<td><?= $vatNumberLabel ?>:</td>
<td><?= $vatNumber ?></td>
</tr>
<?php endif ?>
</tbody>
</table>
38 changes: 23 additions & 15 deletions resources/views/settings.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
* @var string $responsibleFirst first name(s) of responsible person
* @var string $responsibleSurname surname(s) of responsible person
* @var string $responsibleSex gender of responsible person ('M', 'F', 'X')
* @var string $vatNumber VAT ID No. or other registration number
* @var string $street
* @var string $city
* @var string $phone
* @var string $fax
* @var string $email
* @var bool $simpleEmail
* @var string $vatNumberLabel Label like "VAT ID No." or other registration number label
* @var string $vatNumber VAT ID No. or other registration number
*/

?>
Expand Down Expand Up @@ -50,7 +51,7 @@ use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
</div>

<label class="col-sm-3 col-form-label wt-page-options-label" for="responsibleSex">
<?= I18N::translate('Sex of responsible person') ?>
<?= I18N::translate('Sex') ?>
</label>

<div class="row">
Expand All @@ -68,19 +69,6 @@ use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;

<p></p>

<h4><?= I18N::translate('Registration data') ?></h4>

<div class="row">
<label class="col-sm-3 col-form-label wt-page-options-label" for="vatNumber">
<?= I18N::translate('VAT ID No. or other registration number (enter label and value)') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
<input class="form-control" id="vatNumber" name="vatNumber" type="text" value="<?= $vatNumber ?>">
</div>
</div>

<p></p>

<h4><?= I18N::translate('Communication data') ?></h4>

<div class="row">
Expand Down Expand Up @@ -126,6 +114,26 @@ use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;

<p></p>

<h4><?= I18N::translate('Registration data') ?></h4>

<div class="row">
<label class="col-sm-3 col-form-label wt-page-options-label" for="vatNumberLabel">
<?= I18N::translate('Label like VAT ID No. or other registration number label') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
<input class="form-control" id="vatNumberLabel" name="vatNumberLabel" type="text" value="<?= $vatNumberLabel ?>">
</div>

<label class="col-sm-3 col-form-label wt-page-options-label" for="vatNumber">
<?= I18N::translate('VAT ID No. or other registration number') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
<input class="form-control" id="vatNumber" name="vatNumber" type="text" value="<?= $vatNumber ?>">
</div>
</div>

<p></p>

<button type="submit" class="btn btn-primary">
<?= view('icons/save') ?>
<?= I18N::translate('save') ?>
Expand Down

0 comments on commit 50dcf4a

Please sign in to comment.