123
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.component.web.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import jdk.vm.ci.meta.Local;
|
||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
@@ -30,13 +31,14 @@ public class I18nConfig {
|
||||
|
||||
@Override
|
||||
public Locale resolveLocale(HttpServletRequest httpServletRequest) {
|
||||
String language = httpServletRequest.getHeader("content-language");
|
||||
Locale locale = Locale.getDefault();
|
||||
if (StrUtil.isNotBlank(language)) {
|
||||
String[] split = language.split("_");
|
||||
locale = new Locale(split[0], split[1]);
|
||||
}
|
||||
return locale;
|
||||
return Locale.CHINA;
|
||||
// String language = httpServletRequest.getHeader("content-language");
|
||||
// Locale locale = Locale.getDefault();
|
||||
// if (StrUtil.isNotBlank(language)) {
|
||||
// String[] split = language.split("_");
|
||||
// locale = new Locale(split[0], split[1]);
|
||||
// }
|
||||
// return locale;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user