Skip to content

Make validation errors translatable - #55

Open
mahdyaralipor wants to merge 1 commit into
webisters:mainfrom
mahdyaralipor:fix/translatable-validation-errors
Open

Make validation errors translatable#55
mahdyaralipor wants to merge 1 commit into
webisters:mainfrom
mahdyaralipor:fix/translatable-validation-errors

Conversation

@mahdyaralipor

Copy link
Copy Markdown

the hard-coded English validation messages into language keys so they follow the console locale:

  • add 'argument', 'option', 'validation.required' and 'validation.type' keys to the en, es and pt-br language files
  • render validation messages through the console language, falling back to the previous English strings when the command has no console
  • drop the #[Pure] attribute as message rendering no longer is pure

Closes #52

Summary

Related issue

Closes #

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / internal change
  • Build, CI, or tooling

Checklist

  • I read CONTRIBUTING.md
  • vendor/bin/phpunit passes locally
  • vendor/bin/php-cs-fixer fix --dry-run --diff reports no violations
  • Tests were added or updated for this change
  • Documentation (README or docs) was updated where needed
  • This change is backwards compatible (if not, describe the break below)

Backwards compatibility notes

None

Turns the hard-coded English validation messages into language keys so
they follow the console locale:

- add 'argument', 'option', 'validation.required' and 'validation.type'
  keys to the en, es and pt-br language files
- render validation messages through the console language, falling back
  to the previous English strings when the command has no console
- drop the #[Pure] attribute as message rendering no longer is pure

Closes webisters#52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validation error messages are not translatable

1 participant