2
0

feat: 操作日志统一英语

This commit is contained in:
caiyuchao
2025-04-25 14:49:47 +08:00
parent b99d2600f7
commit 3a69f83746
5 changed files with 23 additions and 11 deletions

View File

@@ -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;
}
}
}