[英]FOSOAuthServerBundle translate error messages
I installed FOSOAuthServerBundle
and everything went well, but I don't know how to translate error messages like this: 我安装了
FOSOAuthServerBundle
,一切顺利,但是我不知道如何翻译这样的错误消息:
{"error":"invalid_request","error_description":"Invalid grant_type parameter or parameter missing"}
{“错误”:“ invalid_request”,“错误描述”:“无效的Grant_type参数或缺少参数”}
I want to provide translation for error messages in languages other than English (eg French). 我想用英语以外的其他语言(例如法语)为错误消息提供翻译。 Any solution?
有什么办法吗?
a friend tell me that he resolved it with extending OAuth2/OAuth2 class and overriding methods. 一位朋友告诉我,他通过扩展OAuth2 / OAuth2类和替代方法解决了该问题。 You can override the default package class OAuth2 in services.yml:
您可以在services.yml中覆盖默认的包类OAuth2:
parameters:
fos_oauth_server.server.class: My\Bundle\OAuth2\OAuth2
it may be a solution but it should be an other solution with configuration 它可能是一个解决方案,但它应该是带有配置的其他解决方案
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.