1 2 3 4 5 6 7 8 9 10 11 12 13
| public class I18nToolUtils {
private final static MessageSource messageSource = SpringBeanUtils.getBean(MessageSource.class);
public static String getI18String(String code) { if (StringUtils.isBlank(code)) return null; return messageSource.getMessage(code, null, LocaleContextHolder.getLocale()); } }
|