使用rest api时候枚举翻译无效

你好,我在使用rest api请求我的枚举类 通过设置Accept-Language:zh_CN无效
这是我的枚举设置的中文
image
使用Accept-Language:zh_CN并不能得到我的中文翻译
image

image

感谢反馈,是有这个问题。作为临时方案,可以在 application.properties 修改配置:

jmix.core.available-locales = zh_CN,en

把 zh_CN 放到前面。

GitHub issue created: REST: get enum for specific language not work · Issue #1472 · jmix-framework/jmix · GitHub

调试了一下,zh_CN好像不是JDK支持的标识符,zh-CN就没问题,也就是 Accept-Language填 zh-CN或zh-cn都可以。如果没有识别的话jmix好像会取设置的第一个语言的内容

image

image

试了下,确实设置 zh-cn 就可以了。

@bryanyin 文档需要更新。