From 771a4caf4d1dcecd8fae6ecbbf3a4516fcb30444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Skowro=C5=84ski?= Date: Sat, 28 Oct 2023 17:45:01 +0200 Subject: [PATCH] Make validator messages consistent with Symfony --- src/Validator/Attendance/UniqueAttendance.php | 2 +- src/Validator/Dlc/SteamStoreArma3DlcUrl.php | 6 ++-- src/Validator/Dlc/UniqueDirectoryDlc.php | 2 +- src/Validator/Dlc/UniqueSteamStoreDlc.php | 2 +- .../Mod/SteamWorkshopArma3ModUrl.php | 8 ++--- src/Validator/Mod/UniqueDirectoryMod.php | 2 +- src/Validator/Mod/UniqueSteamWorkshopMod.php | 2 +- src/Validator/ModGroup/UniqueModGroupName.php | 2 +- src/Validator/ModList/UniqueModListName.php | 2 +- src/Validator/SteamProfileId.php | 2 +- src/Validator/User/UniqueUserSteamId.php | 2 +- .../UserGroup/UniqueUserGroupName.php | 2 +- src/Validator/WindowsDirectoryName.php | 2 +- translations/validators.pl.yaml | 34 +++++++++---------- 14 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/Validator/Attendance/UniqueAttendance.php b/src/Validator/Attendance/UniqueAttendance.php index 1457a959..5cf1d713 100644 --- a/src/Validator/Attendance/UniqueAttendance.php +++ b/src/Validator/Attendance/UniqueAttendance.php @@ -9,7 +9,7 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class UniqueAttendance extends Constraint { - public string $message = 'Attendance of player "{{ playerId }}" in mission "{{ missionId }}" already exists'; + public string $message = 'Attendance of player "{{ playerId }}" in mission "{{ missionId }}" already exists.'; public ?string $errorPath = null; public function __construct( diff --git a/src/Validator/Dlc/SteamStoreArma3DlcUrl.php b/src/Validator/Dlc/SteamStoreArma3DlcUrl.php index 9422c552..e6a8a0f9 100644 --- a/src/Validator/Dlc/SteamStoreArma3DlcUrl.php +++ b/src/Validator/Dlc/SteamStoreArma3DlcUrl.php @@ -9,9 +9,9 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class SteamStoreArma3DlcUrl extends Constraint { - public string $invalidDlcUrlMessage = 'Invalid Steam Store DLC url'; - public string $dlcNotFoundMessage = 'DLC not found'; - public string $notAnArma3DlcMessage = 'Url is not an Arma 3 DLC'; + public string $invalidDlcUrlMessage = 'Invalid Steam Store DLC url.'; + public string $dlcNotFoundMessage = 'DLC not found.'; + public string $notAnArma3DlcMessage = 'Url is not an Arma 3 DLC.'; public ?string $errorPath = null; public function __construct( diff --git a/src/Validator/Dlc/UniqueDirectoryDlc.php b/src/Validator/Dlc/UniqueDirectoryDlc.php index 55ab72ef..ce42ed22 100644 --- a/src/Validator/Dlc/UniqueDirectoryDlc.php +++ b/src/Validator/Dlc/UniqueDirectoryDlc.php @@ -9,7 +9,7 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class UniqueDirectoryDlc extends Constraint { - public string $message = 'DLC associated with directory "{{ directoryName }}" already exist'; + public string $message = 'DLC associated with directory "{{ directoryName }}" already exist.'; public ?string $errorPath = null; public function __construct( diff --git a/src/Validator/Dlc/UniqueSteamStoreDlc.php b/src/Validator/Dlc/UniqueSteamStoreDlc.php index 8b66688a..fac5ab0b 100644 --- a/src/Validator/Dlc/UniqueSteamStoreDlc.php +++ b/src/Validator/Dlc/UniqueSteamStoreDlc.php @@ -9,7 +9,7 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class UniqueSteamStoreDlc extends Constraint { - public string $message = 'DLC associated with url "{{ dlcUrl }}" already exist'; + public string $message = 'DLC associated with url "{{ dlcUrl }}" already exist.'; public ?string $errorPath = null; public function __construct( diff --git a/src/Validator/Mod/SteamWorkshopArma3ModUrl.php b/src/Validator/Mod/SteamWorkshopArma3ModUrl.php index 4baef8d2..966bc672 100644 --- a/src/Validator/Mod/SteamWorkshopArma3ModUrl.php +++ b/src/Validator/Mod/SteamWorkshopArma3ModUrl.php @@ -9,10 +9,10 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class SteamWorkshopArma3ModUrl extends Constraint { - public string $invalidModUrlMessage = 'Invalid Steam Workshop mod url'; - public string $modNotFoundMessage = 'Mod not found'; - public string $notAnArma3ModMessage = 'Url is not an Arma 3 mod'; - public string $modIsPrivateOrMissingDetails = 'Mod is either private or missing required details'; + public string $invalidModUrlMessage = 'Invalid Steam Workshop mod url.'; + public string $modNotFoundMessage = 'Mod not found.'; + public string $notAnArma3ModMessage = 'Url is not an Arma 3 mod.'; + public string $modIsPrivateOrMissingDetails = 'Mod is either private or missing required details.'; public ?string $errorPath = null; public ?string $nameErrorPath = null; diff --git a/src/Validator/Mod/UniqueDirectoryMod.php b/src/Validator/Mod/UniqueDirectoryMod.php index a8e336b7..f6a6b1a4 100644 --- a/src/Validator/Mod/UniqueDirectoryMod.php +++ b/src/Validator/Mod/UniqueDirectoryMod.php @@ -9,7 +9,7 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class UniqueDirectoryMod extends Constraint { - public string $message = 'Mod associated with directory "{{ directoryName }}" already exist'; + public string $message = 'Mod associated with directory "{{ directoryName }}" already exist.'; public ?string $errorPath = null; public function __construct( diff --git a/src/Validator/Mod/UniqueSteamWorkshopMod.php b/src/Validator/Mod/UniqueSteamWorkshopMod.php index f84fb807..014829e7 100644 --- a/src/Validator/Mod/UniqueSteamWorkshopMod.php +++ b/src/Validator/Mod/UniqueSteamWorkshopMod.php @@ -9,7 +9,7 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class UniqueSteamWorkshopMod extends Constraint { - public string $message = 'Mod associated with url "{{ modUrl }}" already exist'; + public string $message = 'Mod associated with url "{{ modUrl }}" already exist.'; public ?string $errorPath = null; public function __construct( diff --git a/src/Validator/ModGroup/UniqueModGroupName.php b/src/Validator/ModGroup/UniqueModGroupName.php index e11e2592..cbc80246 100644 --- a/src/Validator/ModGroup/UniqueModGroupName.php +++ b/src/Validator/ModGroup/UniqueModGroupName.php @@ -9,7 +9,7 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class UniqueModGroupName extends Constraint { - public string $message = 'Mod group with the same name "{{ modGroupName }}" already exist'; + public string $message = 'Mod group with the same name "{{ modGroupName }}" already exist.'; public ?string $errorPath = null; public function __construct( diff --git a/src/Validator/ModList/UniqueModListName.php b/src/Validator/ModList/UniqueModListName.php index 06d1c762..1dbff1f3 100644 --- a/src/Validator/ModList/UniqueModListName.php +++ b/src/Validator/ModList/UniqueModListName.php @@ -9,7 +9,7 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class UniqueModListName extends Constraint { - public string $message = 'Mod list with the same name "{{ modListName }}" already exist'; + public string $message = 'Mod list with the same name "{{ modListName }}" already exist.'; public ?string $errorPath = null; public function __construct( diff --git a/src/Validator/SteamProfileId.php b/src/Validator/SteamProfileId.php index d6678fab..f29dac56 100644 --- a/src/Validator/SteamProfileId.php +++ b/src/Validator/SteamProfileId.php @@ -10,7 +10,7 @@ class SteamProfileId extends Regex { /** @var string */ - public $message = 'Invalid Steam profile ID'; + public $message = 'Invalid Steam profile ID.'; /** @var string */ public $pattern = '~^\d{17}$~'; diff --git a/src/Validator/User/UniqueUserSteamId.php b/src/Validator/User/UniqueUserSteamId.php index 475bd726..a403edbb 100644 --- a/src/Validator/User/UniqueUserSteamId.php +++ b/src/Validator/User/UniqueUserSteamId.php @@ -9,7 +9,7 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class UniqueUserSteamId extends Constraint { - public string $message = 'User with the same Steam ID "{{ userSteamId }}" already exist'; + public string $message = 'User with the same Steam ID "{{ userSteamId }}" already exist.'; public ?string $errorPath = null; public function __construct( diff --git a/src/Validator/UserGroup/UniqueUserGroupName.php b/src/Validator/UserGroup/UniqueUserGroupName.php index 1c63cbcd..a1d50114 100644 --- a/src/Validator/UserGroup/UniqueUserGroupName.php +++ b/src/Validator/UserGroup/UniqueUserGroupName.php @@ -9,7 +9,7 @@ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] class UniqueUserGroupName extends Constraint { - public string $message = 'User group with the same name "{{ userGroupName }}" already exist'; + public string $message = 'User group with the same name "{{ userGroupName }}" already exist.'; public ?string $errorPath = null; public function __construct( diff --git a/src/Validator/WindowsDirectoryName.php b/src/Validator/WindowsDirectoryName.php index bb1b666f..c2ed62f7 100644 --- a/src/Validator/WindowsDirectoryName.php +++ b/src/Validator/WindowsDirectoryName.php @@ -10,7 +10,7 @@ class WindowsDirectoryName extends Regex { /** @var string */ - public $message = 'Invalid directory name'; + public $message = 'Invalid directory name.'; /** @var string */ public $pattern = '/^.{1,248}[^<>:"\/\|?*]$/ui'; diff --git a/translations/validators.pl.yaml b/translations/validators.pl.yaml index b745fdec..dcd51608 100644 --- a/translations/validators.pl.yaml +++ b/translations/validators.pl.yaml @@ -1,40 +1,40 @@ # Unique User Steam Id Validator -User with the same Steam ID "{{ userSteamId }}" already exist: Użytkownik o Steam ID "{{ userSteamId }}" już istnieje +User with the same Steam ID "{{ userSteamId }}" already exist.: Użytkownik o Steam ID "{{ userSteamId }}" już istnieje. # Steam Profile Id Validator -Invalid Steam profile ID: Błędne ID profilu Steam +Invalid Steam profile ID.: Błędne ID profilu Steam # Unique Steam Workshop Mod Validator -Mod associated with url "{{ modUrl }}" already exist: Mod znajdujący się pod adresem "{{ modUrl }}" już istnieje +Mod associated with url "{{ modUrl }}" already exist.: Mod znajdujący się pod adresem "{{ modUrl }}" już istnieje. # Unique Steam Store Dlc Validator -DLC associated with url "{{ dlcUrl }}" already exist: DLC znajdujący się pod adresem "{{ dlcUrl }}" już istnieje +DLC associated with url "{{ dlcUrl }}" already exist.: DLC znajdujący się pod adresem "{{ dlcUrl }}" już istnieje. # Unique Directory Mod Validator -Mod associated with directory "{{ directoryName }}" already exist: Mod znajdujący się w katalogu "{{ directoryName }}" już istnieje +Mod associated with directory "{{ directoryName }}" already exist.: Mod znajdujący się w katalogu "{{ directoryName }}" już istnieje. # Unique Directory Dlc Validator -DLC associated with directory "{{ directoryName }}" already exist: DLC znajdujący się w katalogu "{{ directoryName }}" już istnieje +DLC associated with directory "{{ directoryName }}" already exist.: DLC znajdujący się w katalogu "{{ directoryName }}" już istnieje. # Steam Workshop Arma 3 Mod Url Validator -Invalid Steam Workshop mod url: Błędny link do moda -Mod not found: Nie znaleziono moda -Url is not an Arma 3 mod: Mod nie jest modem do Arma 3 -Mod is either private or missing required details: Mod jest prywatny lub nie zawiera niezbędnych do jego dodania informacji +Invalid Steam Workshop mod url.: Błędny link do moda. +Mod not found.: Nie znaleziono moda. +Url is not an Arma 3 mod.: Mod nie jest modem do Arma 3. +Mod is either private or missing required details.: Mod jest prywatny lub nie zawiera niezbędnych do jego dodania informacji. # Steam Store Arma 3 Dlc Url Validator -Invalid Steam Workshop DLC url: Błędny link do DLC -DLC not found: Nie znaleziono DLC -Url is not an Arma 3 DLC: DLC nie jest dodatkiem do Arma 3 +Invalid Steam Workshop DLC url.: Błędny link do DLC. +DLC not found.: Nie znaleziono DLC. +Url is not an Arma 3 DLC.: DLC nie jest dodatkiem do Arma 3. # Windows Directory Name Validator -Invalid directory name: Błędny format nazwy katalogu +Invalid directory name.: Błędny format nazwy katalogu. # Unique Mod List Name Validator -Mod list with the same name "{{ modListName }}" already exist: Lista modów o nazwie "{{ modListName }}" już istnieje +Mod list with the same name "{{ modListName }}" already exist.: Lista modów o nazwie "{{ modListName }}" już istnieje. # Unique Mod Group Name Validator -Mod group with the same name "{{ modGroupName }}" already exist: Grupa modów o nazwie "{{ modGroupName }}" już istnieje +Mod group with the same name "{{ modGroupName }}" already exist.: Grupa modów o nazwie "{{ modGroupName }}" już istnieje. # Unique User Group Name Validator -User group with the same name "{{ userGroupName }}" already exist: Grupa użytkowników o nazwie "{{ userGroupName }}" już istnieje +User group with the same name "{{ userGroupName }}" already exist.: Grupa użytkowników o nazwie "{{ userGroupName }}" już istnieje.