feat: 操作日志统一英语
This commit is contained in:
@@ -6,6 +6,8 @@ import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.NoSuchMessageException;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* 获取i18n资源文件
|
||||
*
|
||||
@@ -30,4 +32,13 @@ public class MessageUtils {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
||||
public static String messageEnUS(String code, Object... args) {
|
||||
try {
|
||||
Locale locale = new Locale("en", "US");
|
||||
return MESSAGE_SOURCE.getMessage(code, args, locale);
|
||||
} catch (NoSuchMessageException e) {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user