Skip to content

Commit ba63a26

Browse files
authored
Merge pull request #26 from vdhicts/feature/translations
Improve translations
2 parents 8e80c2b + 06ee77a commit ba63a26

23 files changed

+43
-65
lines changed

resources/lang/en/validationRules.php renamed to resources/lang/en/messages.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
return [
44
'bic_number' => 'The :attribute must be a valid BIC number',
5-
'contains' => 'The :attribute must contain `%s`',
6-
'contains_any' => 'The :attribute must contain one of these values: `%s`',
7-
'date_after_or_equal' => 'The :attribute must be after or equal to `%s`',
8-
'date_before_or_equal' => 'The :attribute must be before or equal to `%s`',
5+
'contains' => 'The :attribute must contain `:value`',
6+
'contains_any' => 'The :attribute must contain one of these values: `:values`',
7+
'date_after_or_equal' => 'The :attribute must be after or equal to `:date`',
8+
'date_before_or_equal' => 'The :attribute must be before or equal to `:date`',
99
'date_has_specific_minutes' => 'The :attribute must have one of :minutes minutes',
1010
'dutch_phone' => 'The :attribute must be a valid dutch phone number',
1111
'dutch_postal_code' => 'The :attribute must be a valid dutch post code',
1212
'hex_color' => 'The :attribute must be a valid Hex color',
1313
'hostname' => 'The :attribute must be a valid hostname',
1414
'iban' => 'The :attribute must be a valid IBAN',
1515
'interval' => 'The :attribute must be an interval',
16-
'maximum_hour_difference' => 'The start and end date differ more then %s hours',
16+
'maximum_hour_difference' => 'The start and end date differ more then :diff hours',
1717
'mime_type' => 'The :attribute must be a valid MIME',
18-
'not_contains' => 'The :attribute must not contain `%s`',
19-
'not_ends_with' => 'The :attribute must not end with `%s`',
20-
'not_starts_with' => 'The :attribute must not start with `%s`',
18+
'not_contains' => 'The :attribute must not contain `:value`',
19+
'not_ends_with' => 'The :attribute must not end with `:value',
20+
'not_starts_with' => 'The :attribute must not start with `:value`',
2121
'password_strength' => 'The :attribute must contains at least one capital letter, one lowercase letter and one number',
2222
'phone' => 'The :attribute must be a valid phone number',
2323
'positive_interval' => 'The :attribute must be a positive interval',
24-
'price_custom_decimal' => 'The :attribute must be a valid price like `10%s95`',
24+
'price_custom_decimal' => 'The :attribute must be a valid price like `10 :separator 95`',
2525
'price' => 'The :attribute must be a valid price like `10,95` or `10.50`',
2626
'semver' => 'The :attribute must be a valid version according to the semver standard',
2727
'secure_url' => 'The :attribute must be a HTTPS url',

resources/lang/nl/validationRules.php renamed to resources/lang/nl/messages.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,26 @@
22

33
return [
44
'bic_number' => 'Het veld :attribute moet een geldig BIC nummer bevatten',
5-
'contains_any' => 'Het veld :attribute moet een van deze waardes bevatten: `%s`',
6-
'date_after_or_equal' => 'Het veld :attribute moet na of op `%s` zijn',
7-
'date_before_or_equal' => 'Het veld :attribute moet voor of op `%s` zijn',
5+
'contains' => 'Het veld :attribute moet `:value` bevatten',
6+
'contains_any' => 'Het veld :attribute moet een van deze waardes bevatten: `:values',
7+
'date_after_or_equal' => 'Het veld :attribute moet na of op `:date` zijn',
8+
'date_before_or_equal' => 'Het veld :attribute moet voor of op `:date` zijn',
89
'date_has_specific_minutes' => 'Het veld :attribute moet ingesteld zijn op een van :minutes minuten',
910
'dutch_phone' => 'Het veld :attribute moet een geldig telefoonnummer bevatten',
1011
'dutch_postal_code' => 'Het veld :attribute moet een geldige postcode bevatten',
1112
'hex_color' => 'Het veld :attribute moet een geldige Hex kleur bevatten',
1213
'hostname' => 'Het veld :attribute moet een geldige hostname bevatten',
1314
'iban' => 'Het veld :attribute moet een geldige IBAN bevatten',
1415
'interval' => 'Het veld :attribute moet een interval zijn',
15-
'maximum_hour_difference' => 'De start en eind datum moeten meer dan %s uur verschil',
16+
'maximum_hour_difference' => 'De start en eind datum moeten meer dan :diff uur verschil',
1617
'mime_type' => 'Het veld :attribute moet een geldig MIME-type zijn',
17-
'not_contains' => 'Het veld :attribute mag geen `%s` bevatten',
18-
'not_ends_with' => 'Het veld :attribute mag niet eindigen met `%s`',
19-
'not_starts_with' => 'Het veld :attribute mag niet beginnen `%s`',
18+
'not_contains' => 'Het veld :attribute mag geen `:value` bevatten',
19+
'not_ends_with' => 'Het veld :attribute mag niet eindigen met `:value`',
20+
'not_starts_with' => 'Het veld :attribute mag niet beginnen `:value`',
2021
'password' => 'Het veld :attribute moet minstens een hoofdletter, een kleine letter en een nummer bevatten',
2122
'phone' => 'Het veld :attribute moet een geldig telefoonnummer bevatten',
2223
'positive_interval' => 'Het veld :attribute moet een positieve interval bevatten',
23-
'price_custom_decimal' => 'Het veld :attribute moet een geldig bedrag bevatten, zoals `10%s95`',
24+
'price_custom_decimal' => 'Het veld :attribute moet een geldig bedrag bevatten, zoals `10 :separator 95`',
2425
'price' => 'Het veld :attribute moet een geldig bedrag bevatten, zoals `10,95` of `10.50`',
2526
'secure_url' => 'Het veld :attribute moet een HTTPS url zijn',
2627
'semver' => 'Het veld :attribute moet een geldige versie zijn volgens de semver standaard',

src/Rules/BicNumber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public function passes(mixed $value): bool
1313

1414
public function message(): string
1515
{
16-
return __('validationRules.bic_number');
16+
return __('validationRules::messages.bic_number');
1717
}
1818
}

src/Rules/Contains.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ public function passes(mixed $value): bool
2121

2222
public function message(): string
2323
{
24-
return sprintf(
25-
__('validationRules.contains'),
26-
$this->needle
27-
);
24+
return __('validationRules::messages.contains', ['value' => $this->needle]);
2825
}
2926
}

src/Rules/ContainsAny.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ public function passes(mixed $value): bool
1717

1818
public function message(): string
1919
{
20-
return sprintf(
21-
__('validationRules.contains_any'),
22-
implode(', ', $this->needles)
23-
);
20+
return __('validationRules::messages.contains_any', ['values' => implode(', ', $this->needles)]);
2421
}
2522
}

src/Rules/DateAfterOrEqual.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ public function passes(mixed $value): bool
2121

2222
public function message(): string
2323
{
24-
return sprintf(
25-
__('validationRules.date_after_or_equal'),
26-
$this->date->format('c')
27-
);
24+
return __('validationRules::messages.date_after_or_equal', ['date' => $this->date->format('c')]);
2825
}
2926
}

src/Rules/DateBeforeOrEqual.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ public function passes(mixed $value): bool
2626

2727
public function message(): string
2828
{
29-
return sprintf(
30-
__('validationRules.date_before_or_equal'),
31-
$this->date->format('c')
32-
);
29+
return __('validationRules::messages.date_before_or_equal', ['date' => $this->date->format('c')]);
3330
}
3431
}

src/Rules/DateHasSpecificMinutes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function passes(mixed $value): bool
2828

2929
public function message(): string
3030
{
31-
return trans('validationRules.date_has_specific_minutes', [
31+
return __('validationRules::messages.date_has_specific_minutes', [
3232
'minutes' => implode(', ', $this->allowedMinutes),
3333
]);
3434
}

src/Rules/DutchPhone.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public function passes(mixed $value): bool
1313

1414
public function message(): string
1515
{
16-
return __('validationRules.dutch_phone');
16+
return __('validationRules::messages.dutch_phone');
1717
}
1818
}

src/Rules/DutchPostalCode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public function passes(mixed $value): bool
1313

1414
public function message(): string
1515
{
16-
return __('validationRules.dutch_postal_code');
16+
return __('validationRules::messages.dutch_postal_code');
1717
}
1818
}

0 commit comments

Comments
 (0)