apache / apache/servicecomb-java-chassis

如果要扩展参数校验后错误提示的国际化语言,自己定义规则,该怎么实现。

Open
#2,784 6 comments 0 reactions 0 assignees View on GitHub
need discussion
Dominant language
Java
Stars
1.9k
Forks
814
Avg merge
8d 23h
Merged PRs (30d)
1

Description

通过hibernate-validator的注解抛出的参数校验异常,看源码会使用默认语言进行国际化,这个默认语言没追溯到时如何初始化的,这块是否可以扩展,自定义业务的语言选择,例如根据用户注册地区进行选择语言,或者根据请求头Accept-Language选择语言等等。

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how Hibernate Validator annotation failures obtain and initialize the default locale in the validation path. Compare that behavior with the requested business locale sources, such as the registration region and the Accept-Language request header. Done should be a documented, project-supported way to select validation-error languages, with its expected precedence and behavior defined.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
internationalization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.