Skip to content

Proposal: validation-strings without attribute placeholder #1268

@kohlerdominik

Description

@kohlerdominik

Hi

Issue

By default Laravel always uses the :attributes-Placeholder in it's validation strings.
But for example in in Material Design it's recommendet to provide the Error Message right next to the Input field (Source). This kind of makes the :attribute a redundancy. While for english, the guessed names may be usuable mostly (not always pretty, but at least usable), for other languages you're basically forced to translate every attribute as well.

For me, it's is especially cumbersome if you have devided front- and backend. You need to maintain the attribute name once in the Frontend Label-tag, and once in the Backend, while there's basically no benefit in it.


Example how this currently looks like (rule:numeric)
grafik

Example from the same in german or french
grafik
Note how the label is translated, but the :attribute would require an extra translation in this case.


Proposed Solution

Within this package, we could start a second series of translations with more generic text, which do not use the :attribute-tag in the translated string. So in above examples, it would mean using something like

This has to be a number.
Das muss eine Zahl sein.
Il doit s'agir d'un numéro [translation from DeepL]

I would be happy to help with this. However, the benefit should be reasonable to others, too, so we can quickly start with a couple of languages like English (by me), German (by me), French, Spanish?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions