Browse Source

update locale

pull/485/MERGE
RuoYi 8 months ago
parent
commit
85cf318a94
  1. 4
      ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java

4
ruoyi-common/src/main/java/com/ruoyi/common/utils/MessageUtils.java

@ -1,7 +1,7 @@
package com.ruoyi.common.utils;
import org.springframework.context.MessageSource;
import com.ruoyi.common.constant.Constants;
import org.springframework.context.i18n.LocaleContextHolder;
import com.ruoyi.common.utils.spring.SpringUtils;
/**
@ -21,6 +21,6 @@ public class MessageUtils
public static String message(String code, Object... args)
{
MessageSource messageSource = SpringUtils.getBean(MessageSource.class);
return messageSource.getMessage(code, args, Constants.DEFAULT_LOCALE);
return messageSource.getMessage(code, args, LocaleContextHolder.getLocale());
}
}

Loading…
Cancel
Save