Skip to content

Commit

Permalink
Revert "Removed the useless nc_tokens. prefix for token descriptions"
Browse files Browse the repository at this point in the history
This reverts commit ff727da.
  • Loading branch information
Toflar committed Feb 21, 2024
1 parent f17d202 commit 165d1d6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
12 changes: 6 additions & 6 deletions contao/languages/de/nc_tokens.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
<xliff version="1.2">
<file datatype="php" source-language="en" target-language="de">
<body>
<trans-unit id="admin_email">
<trans-unit id="nc_tokens.admin_email">
<source>E-mail address of administrator of the current page (website root settings).</source>
<target>E-Mail-Adresse des Administrators der aktuellen Seite (Einstellungen der Rootseite).</target>
</trans-unit>
<trans-unit id="form.form_*">
<trans-unit id="nc_tokens.form.form_*">
<source>All the form fields.</source>
<target>Alle Formularfelder.</target>
</trans-unit>
<trans-unit id="form.formlabel_*">
<trans-unit id="nc_tokens.form.formlabel_*">
<source>All the form field labels.</source>
<target>Alle Formularfeld-Labels.</target>
</trans-unit>
<trans-unit id="form.formconfig_*">
<trans-unit id="nc_tokens.form.formconfig_*">
<source>All the form generator configuration fields.</source>
<target>Alle Konfigurationsfelder des Formular-Generators.</target>
</trans-unit>
<trans-unit id="form.raw_data">
<trans-unit id="nc_tokens.form.raw_data">
<source>All the form fields and their raw values.</source>
<target>Alle Formularfelder und deren Rohdaten.</target>
</trans-unit>
<trans-unit id="form.raw_data_filled">
<trans-unit id="nc_tokens.form.raw_data_filled">
<source>All filled in form fields and their raw values.</source>
<target>Alle ausgefüllten Formularfelder und deren Rohdaten.</target>
</trans-unit>
Expand Down
12 changes: 6 additions & 6 deletions contao/languages/en/nc_tokens.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
<xliff version="1.2">
<file datatype="php" source-language="en" target-language="en">
<body>
<trans-unit id="admin_email">
<trans-unit id="nc_tokens.admin_email">
<source>E-mail address of administrator of the current page (website root settings).</source>
<target>E-mail address of administrator of the current page (website root settings).</target>
</trans-unit>
<trans-unit id="form.form_*">
<trans-unit id="nc_tokens.form.form_*">
<source>All the form fields.</source>
<target>All the form fields.</target>
</trans-unit>
<trans-unit id="form.formlabel_*">
<trans-unit id="nc_tokens.form.formlabel_*">
<source>All the form field labels.</source>
<target>All the form field labels.</target>
</trans-unit>
<trans-unit id="form.formconfig_*">
<trans-unit id="nc_tokens.form.formconfig_*">
<source>All the form generator configuration fields.</source>
<target>All the form generator configuration fields.</target>
</trans-unit>
<trans-unit id="form.raw_data">
<trans-unit id="nc_tokens.form.raw_data">
<source>All the form fields and their raw values.</source>
<target>All the form fields and their raw values.</target>
</trans-unit>
<trans-unit id="form.raw_data_filled">
<trans-unit id="nc_tokens.form.raw_data_filled">
<source>All filled in form fields and their raw values.</source>
<target>All filled in form fields and their raw values.</target>
</trans-unit>
Expand Down
1 change: 1 addition & 0 deletions src/Backend/AutoSuggester.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ private function getTokenConfigForField(string $notificationType, string $contex
$label = '';

if (($translationKey = $token->getTranslationKey()) !== null) {
$translationKey = 'nc_tokens.'.$translationKey;
$label = $this->translator->trans($translationKey, [], 'contao_nc_tokens');

// Missing label would return the key untranslated, we ignore in that case
Expand Down
5 changes: 3 additions & 2 deletions src/Token/Definition/TokenDefinitionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ public function getTokenName(): string;

/**
* Every token definition can have a description coming from the translation domain
* "contao_nc_tokens". So if you return e.g. "form.foobar" here, the Notification Center
* will search for the translation key "form.foobar" in the "contao_nc_tokens" domain.
* "contao_nc_tokens". The translation key here is prefixed with "nc_tokens." so
* if you return e.g. "form.foobar" here, the Notification Center will search for
* the translation key "nc_tokens.form.foobar" in the "contao_nc_tokens" domain.
*/
public function getTranslationKey(): string;

Expand Down

0 comments on commit 165d1d6

Please sign in to comment.