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

Feature request: i18n / localization #108

Closed
Reggino opened this issue Jul 9, 2014 · 12 comments
Closed

Feature request: i18n / localization #108

Reggino opened this issue Jul 9, 2014 · 12 comments

Comments

@Reggino
Copy link

Reggino commented Jul 9, 2014

Thanks for this great library.

It would be awesome if error messages could be localized.

@lube
Copy link

lube commented Apr 11, 2016

+1

@bighappyface
Copy link
Collaborator

Is the idea that translated error messages would be helpful to developers using this package or for end users of an application using this package?

@lube
Copy link

lube commented Apr 12, 2016

The latter of course. The idea is we should have some way to translate the messages for end users without having to fork the project or parse the errors ourselves.

@bighappyface
Copy link
Collaborator

Error messages provide the property, failing constraint, and constraint details in a consumable format independent of any given language/locale.

For an end-user application I am curious how the user would find value in schema validation error messages over specialized messages focused on the user experience. Printing what in some cases are cryptic messages wouldn't be very helpful to an end user unless the application was a json schema validator like jsonschema.net, but that is my opinion.

If we introduced translated/localized messages, who provides those translations, and what languages/locales would be appropriate? If the language you need is not available, a PR would still be unavoidable, and no PR would be accepted unless all strings were translated.

I believe there are bigger fish to fry for this package, and that there are adequate facilities present in the package to provide package consumers with the ability to integrate validation error into their localized end-user application. That being said, PRs are always welcome.

@jojo1981
Copy link

I agree with @bighappyface that translated/localized messages doesn't belong into the schema. A solution for the problem can be to attach unique error codes to the constraint errors (the current English messages will be untouched). so the library user can map the error codes to there own translated/localized messages. @bighappyface what do you think of this as a solution?

@lube
Copy link

lube commented Apr 13, 2016

Great Input @jojo1981 I was thinking something along those lines, not actually providing error strings on different languages, just a more happy way to parse and interface with the schema errors.

@bighappyface
Copy link
Collaborator

@lube
Copy link

lube commented Apr 13, 2016

@bighappyface You are absolutely correct, the symfony bundle I used, didn't expose the constraints, thanks for taking the time to answer this.

@jojo1981
Copy link

@lube When the answer is sufficient enough, can you please close this issue? Thanks in advanced.

@lube
Copy link

lube commented Apr 14, 2016

I would but I don't think I can, I didn't open this issue.

@jojo1981
Copy link

@Reggino When the answer is sufficient enough, can you please close this issue? Thanks in advanced.

@bighappyface
Copy link
Collaborator

Closing as part of clean up.

soyuka added a commit to soyuka/JsonSchemaBundle that referenced this issue Apr 15, 2016
soyuka added a commit to soyuka/JsonSchemaBundle that referenced this issue Apr 15, 2016
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

No branches or pull requests

4 participants