user6830821
user6830821

Reputation:

FOSOAuthServerBundle translate error messages

I installed FOSOAuthServerBundle and everything went well, but I don't know how to translate error messages like this:

{"error":"invalid_request","error_description":"Invalid grant_type parameter or parameter missing"}

I want to provide translation for error messages in languages other than English (e.g. French). Any solution?

Upvotes: 0

Views: 234

Answers (1)

user6830821
user6830821

Reputation:

a friend tell me that he resolved it with extending OAuth2/OAuth2 class and overriding methods. You can override the default package class OAuth2 in services.yml:

parameters:
    fos_oauth_server.server.class: My\Bundle\OAuth2\OAuth2

it may be a solution but it should be an other solution with configuration

Upvotes: 1

Related Questions