diff --git a/Classes/Controller/BackendServiceController.php b/Classes/Controller/BackendServiceController.php index e50f830518..49ca66258f 100644 --- a/Classes/Controller/BackendServiceController.php +++ b/Classes/Controller/BackendServiceController.php @@ -174,7 +174,9 @@ public function changeAction(array $changes): void $changes->apply(); $success = new Info(); - $success->setMessage(sprintf('%d change(s) successfully applied.', $count)); + $success->setMessage( + $this->getLabel('changesApplied', [$count], $count) + ); $this->feedbackCollection->add($success); } catch (\Exception $e) { @@ -431,9 +433,7 @@ public function changeBaseWorkspaceAction(string $targetWorkspaceName, string $d } catch (WorkspaceIsNotEmptyException $exception) { $error = new Error(); $error->setMessage( - 'Your personal workspace currently contains unpublished changes.' - . ' In order to switch to a different target workspace you need to either publish' - . ' or discard pending changes first.' + $this->getLabel('workspaceContainsUnpublishedChanges') ); $this->feedbackCollection->add($error); @@ -457,7 +457,9 @@ public function changeBaseWorkspaceAction(string $targetWorkspaceName, string $d $documentNode = $subgraph->findNodeById($command->documentNode->nodeAggregateId); $success = new Success(); - $success->setMessage(sprintf('Switched base workspace to %s.', $targetWorkspaceName)); + $success->setMessage( + $this->getLabel('switchedBaseWorkspace', ['workspace' => $targetWorkspaceName]) + ); $this->feedbackCollection->add($success); $updateWorkspaceInfo = new UpdateWorkspaceInfo($contentRepositoryId, $userWorkspaceName); diff --git a/Classes/Controller/TranslationTrait.php b/Classes/Controller/TranslationTrait.php index 4875863b10..33bbcd3de5 100644 --- a/Classes/Controller/TranslationTrait.php +++ b/Classes/Controller/TranslationTrait.php @@ -29,12 +29,12 @@ trait TranslationTrait /** * @param array $arguments */ - public function getLabel(string $id, array $arguments = []): string + public function getLabel(string $id, array $arguments = [], ?int $quantity = null): string { return $this->translator->translateById( $id, $arguments, - null, + $quantity, null, 'Main', 'Neos.Neos.Ui' diff --git a/Resources/Private/Translations/en/Main.xlf b/Resources/Private/Translations/en/Main.xlf index 43fb072c93..9701c7f569 100644 --- a/Resources/Private/Translations/en/Main.xlf +++ b/Resources/Private/Translations/en/Main.xlf @@ -326,6 +326,14 @@ Discarded {0} changes. + + Switched base workspace to "{workspace}". + + + Your personal workspace currently contains unpublished changes. + In order to switch to a different target workspace you need to either publish or discard pending changes first. + + Syncronize with the title property