mirror of https://gitee.com/stylefeng/roses
【i18n】统一语种编码名称,loginUser增加当前用户的语种
parent
36b7ac11e2
commit
a71a276c28
|
@ -94,6 +94,13 @@ public class LoginUser implements Serializable {
|
|||
*/
|
||||
private String wsUrl;
|
||||
|
||||
/**
|
||||
* 当前用户语种的标识,例如:chinese,english
|
||||
* <p>
|
||||
* 这个值是根据字典获取,字典类型编码 languages
|
||||
*/
|
||||
private String tranLanguageCode;
|
||||
|
||||
public String getWsUrl() {
|
||||
AtomicReference<String> returnUrl = new AtomicReference<>(StrUtil.EMPTY);
|
||||
Optional.ofNullable(this.wsUrl).ifPresent(url -> {
|
||||
|
|
|
@ -26,7 +26,7 @@ public class TranslationDict implements Serializable {
|
|||
/**
|
||||
* 多语言语种的编码,值是字典的值,字典类型的编码是 languages
|
||||
*/
|
||||
private String translationLanguages;
|
||||
private String tranLanguageCode;
|
||||
|
||||
/**
|
||||
* 翻译的值,例如:账号
|
||||
|
|
|
@ -40,7 +40,7 @@ public class TranslationRequest extends BaseRequest {
|
|||
/**
|
||||
* 语种字典
|
||||
*/
|
||||
@NotBlank(message = "language不能为空", groups = {add.class, edit.class})
|
||||
@NotBlank(message = "tranLanguageCode不能为空", groups = {add.class, edit.class})
|
||||
private String tranLanguageCode;
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,7 +22,7 @@ public class TranslationDictFactory {
|
|||
translationDict.setTranName(translation.getTranName());
|
||||
translationDict.setTranCode(translation.getTranCode());
|
||||
translationDict.setTranValue(translation.getTranValue());
|
||||
translationDict.setTranslationLanguages(translationLanguages);
|
||||
translationDict.setTranLanguageCode(translationLanguages);
|
||||
return translationDict;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class TranslationContainer implements TranslationApi {
|
|||
|
||||
@Override
|
||||
public void addTranslationDict(TranslationDict translationDict) {
|
||||
String translationLanguages = translationDict.getTranslationLanguages();
|
||||
String translationLanguages = translationDict.getTranLanguageCode();
|
||||
|
||||
Map<String, String> languageDict = TRAN_DICT_CONTAINER.get(translationLanguages);
|
||||
if (languageDict == null) {
|
||||
|
|
Loading…
Reference in New Issue