|
|
@ -1,6 +1,5 @@
|
|
|
|
package com.ruoyi.framework.config;
|
|
|
|
package com.ruoyi.framework.config;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Locale;
|
|
|
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.web.servlet.LocaleResolver;
|
|
|
|
import org.springframework.web.servlet.LocaleResolver;
|
|
|
@ -8,6 +7,7 @@ import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
|
|
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
|
|
|
|
import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
|
|
|
|
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
|
|
|
|
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
|
|
|
|
|
|
|
|
import com.ruoyi.common.constant.Constants;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 资源文件配置加载
|
|
|
|
* 资源文件配置加载
|
|
|
@ -22,7 +22,7 @@ public class I18nConfig implements WebMvcConfigurer
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SessionLocaleResolver slr = new SessionLocaleResolver();
|
|
|
|
SessionLocaleResolver slr = new SessionLocaleResolver();
|
|
|
|
// 默认语言
|
|
|
|
// 默认语言
|
|
|
|
slr.setDefaultLocale(Locale.SIMPLIFIED_CHINESE);
|
|
|
|
slr.setDefaultLocale(Constants.DEFAULT_LOCALE);
|
|
|
|
return slr;
|
|
|
|
return slr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|