Skip to content

Commit

Permalink
Make translation messages consistent with Symfony validators
Browse files Browse the repository at this point in the history
  • Loading branch information
jskowronski39 committed Jan 7, 2024
1 parent 9ba4259 commit 78d0f87
Show file tree
Hide file tree
Showing 15 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/Validator/Attendance/UniqueAttendance.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions src/Validator/Dlc/SteamStoreArma3DlcUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/Dlc/UniqueDirectoryDlc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/Dlc/UniqueSteamStoreDlc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions src/Validator/Mod/SteamWorkshopArma3ModUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Validator/Mod/UniqueDirectoryMod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/Mod/UniqueSteamWorkshopMod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/ModGroup/UniqueModGroupName.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/ModList/UniqueModListName.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/SteamProfileId.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}$~';
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/User/UniqueUserSteamId.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/UserGroup/UniqueUserGroupName.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/Validator/WindowsDirectoryName.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function createAttendanceAction_duplicatedEntry_returnsUnprocessableEntit

$this::assertResponseStatusCodeSame(Response::HTTP_UNPROCESSABLE_ENTITY);
$this::assertJsonContains([
'detail' => 'Attendance of player "76561198048200529" in mission "mission_1" already exists',
'detail' => 'Attendance of player "76561198048200529" in mission "mission_1" already exists.',
]);
}
}
34 changes: 17 additions & 17 deletions translations/validators.pl.yaml
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 78d0f87

Please sign in to comment.