Skip to content

Commit

Permalink
fix: 修复国际化调用错误 (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
unknowIfGuestInDream committed Oct 20, 2022
1 parent 47a3253 commit 9c58e0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/tlcsdm/common/util/I18nUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public static void setLocale(Locale locale) {
* @param args optional arguments for the message
* @return localized formatted string
*/
public static String get(final String key, final Object... args) {
ResourceBundle bundle = ResourceBundle.getBundle(BASENAME, getLocale());
public static String get(final String key, final Class<?> caller, final Object... args) {
ResourceBundle bundle = ResourceBundle.getBundle(BASENAME, getLocale(), caller.getClassLoader());
return MessageFormat.format(bundle.getString(key), args);
}
}

0 comments on commit 9c58e0f

Please sign in to comment.