Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: validation-strings without attribute placeholder #1268

Closed
kohlerdominik opened this issue Jun 23, 2020 · 2 comments
Closed

Proposal: validation-strings without attribute placeholder #1268

kohlerdominik opened this issue Jun 23, 2020 · 2 comments
Assignees

Comments

@kohlerdominik
Copy link
Contributor

kohlerdominik commented Jun 23, 2020

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?

@caouecs
Copy link
Member

caouecs commented Jun 25, 2020

It's a very good idea, we can do another branch with it

Can you do a pull request with english and german translations ? I can do for French

@kohlerdominik
Copy link
Contributor Author

Hi @caouecs

Thanks for the positive Feedback. I just didn't find time yet, but I'll create the PR next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants