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

Reset Password Page → Translations are not yet possible for the error messages #2512

Closed
helloDanuk opened this issue Sep 23, 2020 · 7 comments
Labels

Comments

@helloDanuk
Copy link
Contributor

Bug Description

The red validation error messages are not yet possible to translate.

Bildschirmfoto_2020-09-18_um_23 44 44

Bildschirmfoto_2020-09-18_um_23 45 04

Bildschirmfoto_2020-09-18_um_23 54 55

Environment

Statamic 3.0.12 Pro
Laravel 7.28.3
PHP 7.4.6
No addons installed

Install method (choose one):

  • Fresh install from statamic/statamic
@edalzell edalzell added the i18n label Sep 23, 2020
@billmn
Copy link
Contributor

billmn commented Oct 8, 2020

To translate Laravel messages (validation errors, ...) you must add translated files in resources/lang/{your-locale} folder.

Here you can find translated message for a lot of languages: https://github.com/Laravel-Lang/lang

@helloDanuk
Copy link
Contributor Author

helloDanuk commented Oct 9, 2020

Thanks for this hint. A fresh statamic installation contains already a resources/lang/en folder and I can add an other language. But the handling of the variable :attribute in the strings is still unclear for me.

…deleted content…

Upps, I missed the last section 'Custom Validation Attributes' in validation.php where attribute placeholders are swapped with something more reader friendly such as E-Mail Address instead of 'email'.

That should be good.

@helloDanuk
Copy link
Contributor Author

helloDanuk commented Oct 9, 2020

Still it would be good to know, where these Laravel messages (validation errors, ...) are used throughout the statamic eco-system? If translation files for them can added with a fresh installation or if the docs needs a section on how to add these files after installation?

@github-actions
Copy link

This issue has not had recent activity and has been marked as stale — by me, a robot. Simply reply to keep it open and send me away. If you do nothing, I will close it in a week. I have no feelings, so whatever you do is fine by me.

@github-actions github-actions bot added the stale label Jan 17, 2021
@helloDanuk
Copy link
Contributor Author

💨🤖

@github-actions github-actions bot removed the stale label Jan 19, 2021
@duncanmcclean
Copy link
Member

Like @billmn said, these translations aren't handled by Statamic's translations but by the default Laravel ones that ship with your app. (as Statamic uses the same authentication under the hood as Laravel and therefore shares the error messages).

I've had a quick look but it doesn't look like there's official Laravel translations for authentication and basic validation. However, I've found this community repository which could be helpful. You should be able to copy in the relevant translation files for your app.

I do agree though that maybe this could be documented as it would be weird for the rest of the Statamic CP to be translated but not for the authentication stuff to be. Maybe this issue belongs inside the statamic/docs issue instead?

@helloDanuk
Copy link
Contributor Author

Thanks for pointing this out again. I agree, it might be something for the docs. So I close this issue here.

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

No branches or pull requests

4 participants