Skip to content

Commit 5329e92

Browse files
committed
Improve documentation
1 parent 1169841 commit 5329e92

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,11 @@ Translation is different with custom messages.
273273
Translation may needed when you use custom message for rule `in`, `not_in`, `mimes`, and `uploaded_file`.
274274

275275
For example if you use rule `in:1,2,3` we will set invalid message like "The Attribute only allows '1', '2', or '3'"
276-
where message "'1', '2', or '3'" is comes from ":allowed_values" tag.
277-
So if you have custom Indonesian message ":attribute hanya mengizinkan :allowed_values",
278-
we will set invalid message like "Attribute hanya mengizinkan '1', '2', or '3'" which is the "or" word is not Indonesian language.
276+
where part "'1', '2', or '3'" is comes from ":allowed_values" tag.
277+
So if you have custom Indonesian message ":attribute hanya memperbolehkan :allowed_values",
278+
we will set invalid message like "Attribute hanya memperbolehkan '1', '2', or '3'" which is the "or" word is not part of Indonesian language.
279279

280-
So, to solves this problem, we can use translation like this:
280+
So, to solve this problem, we can use translation like this:
281281

282282
```php
283283
// Set translation for words 'and' and 'or'.
@@ -287,14 +287,14 @@ $validator->setTranslations([
287287
]);
288288

289289
// Set custom message for 'in' rule
290-
$validator->setMessage('in', ":attribute hanya mengizinkan :allowed_values");
290+
$validator->setMessage('in', ":attribute hanya memperbolehkan :allowed_values");
291291

292292
// Validate
293293
$validation = $validator->validate($inputs, [
294294
'nomor' => 'in:1,2,3'
295295
]);
296296

297-
$message = $validation->errors()->first('nomor'); // "Nomor hanya mengizinkan '1', '2', atau '3'"
297+
$message = $validation->errors()->first('nomor'); // "Nomor hanya memperbolehkan '1', '2', atau '3'"
298298
```
299299

300300
> Actually, our built-in rules only use words 'and' and 'or' that you may need to translates.

0 commit comments

Comments
 (0)