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
Localisation #255
Comments
Hi @ariskemper, could you please provide specific examples of what you would like to localize? LoopBack uses Express under the hood, thus you can add i18next-node library to your LoopBack-based application in the same way you would add it to an Express app. |
Its mean as enhancement in Loopback, because messages in models are currently only in English. |
What kind of messages do you mean? Validation messages? |
Yes i mean validation messages. |
Rather than modifying the error responses returned by the server, you can localise the error message on the client. The validation error response contains error codes in Here is an example error response: {
"name": "ValidationError",
"status": 422,
"message": "The Model instance is not valid. \
See `details` property of the error object for more info.",
"statusCode": 422,
"details": {
"context": "user",
"codes": {
"password": [
"presence"
],
"email": [
"uniqueness"
]
},
"messages": {
"password": [
"can't be blank"
],
"email": [
"Email already exists"
]
}
},
} |
I added a note to http://docs.strongloop.com/display/LB/Validating+model+data. It's pretty minimal, so if you have have additional suggestions, please let me know. |
I have closed the issue. Feel free to reopen if you have more question. |
I read this documentation but was rather confused ... Does that mean that for all places in the Validateable API where I can specify a Example:
NOTE: In some cases a |
@tohagan IIRC, the
I see your point. Could you please open a new GitHub issue to discuss this feature and keep track of it? It is rather off-topic here. |
Would be good that Loopback supports localisation for current models and messages in responses.
Example:
Proposed solution:
The text was updated successfully, but these errors were encountered: