Skip to content

Commit

Permalink
[TASK] Make info messages of InputSlugElement translatable
Browse files Browse the repository at this point in the history
Move the info message text to a xlf file and differ between the slug of
pages and records.

Resolves: #89574
Releases: master, 9.5
Change-Id: I1d68e5b9dcca9cd2559c5e0bdbefc81c79e6b669
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63216
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
  • Loading branch information
georgringer committed Feb 19, 2020
1 parent b79747a commit fcecadb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Expand Up @@ -105,6 +105,9 @@ public function render()
$toggleButtonTitle = $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:buttons.toggleSlugExplanation');
$recreateButtonTitle = $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:buttons.recreateSlugExplanation');

$successMessage = sprintf($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:slugCreation.success.' . ($table === 'pages' ? 'page' : 'record')), $baseUrl);
$errorMessage = sprintf($this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:slugCreation.error'), $baseUrl);

$thisSlugId = 't3js-form-field-slug-id' . StringUtility::getUniqueId();
$mainFieldHtml = [];
$mainFieldHtml[] = '<div class="formengine-field-item t3js-formengine-field-item">';
Expand Down Expand Up @@ -154,8 +157,8 @@ public function render()
$mainFieldHtml[] = '</div>';
}
$mainFieldHtml[] = '<div class="form-wizards-items-bottom">';
$mainFieldHtml[] = '<span class="t3js-form-proposal-accepted hidden label label-success">Congrats, this page will look like ' . htmlspecialchars($baseUrl) . '<span>/abc/</span></span>';
$mainFieldHtml[] = '<span class="t3js-form-proposal-different hidden label label-warning">Hmm, that is taken, how about ' . htmlspecialchars($baseUrl) . '<span>/abc/</span></span>';
$mainFieldHtml[] = '<span class="t3js-form-proposal-accepted hidden label label-success">' . htmlspecialchars($successMessage) . '<span>/abc/</span></span>';
$mainFieldHtml[] = '<span class="t3js-form-proposal-different hidden label label-warning">' . htmlspecialchars($errorMessage) . '<span>/abc/</span></span>';
$mainFieldHtml[] = $fieldWizardHtml;
$mainFieldHtml[] = '</div>';
$mainFieldHtml[] = '</div>';
Expand Down
Expand Up @@ -994,6 +994,15 @@ Do you want to refresh it now?</source>
<trans-unit id="buttons.recreateSlugExplanation" resname="buttons.recreateSlugExplanation">
<source>Recalculate URL segment from page title</source>
</trans-unit>
<trans-unit id="slugCreation.success.page" resname="slugCreation.success.page">
<source>This page will be reachable via %s</source>
</trans-unit>
<trans-unit id="slugCreation.success.record" resname="slugCreation.success.record">
<source>The URL part of this record will be %s</source>
</trans-unit>
<trans-unit id="slugCreation.error" resname="slugCreation.error">
<source>The requested URL is already in use, but %s will be used instead</source>
</trans-unit>
<trans-unit id="cm.copy" resname="cm.copy">
<source>Copy</source>
</trans-unit>
Expand Down

0 comments on commit fcecadb

Please sign in to comment.