Class I18nUtil.I18nMessageFormatter

java.lang.Object
io.github.xezzon.zeroweb.common.i18n.I18nUtil.I18nMessageFormatter
Enclosing class:
I18nUtil

public static class I18nUtil.I18nMessageFormatter extends Object
消息格式化器
  • Constructor Details

    • I18nMessageFormatter

      public I18nMessageFormatter(String basename)
      Parameters:
      basename - 命名空间
  • Method Details

    • locale

      public I18nUtil.I18nMessageFormatter locale(Locale locale)
      Parameters:
      locale - 目标语言
    • format

      public String format(String key, String fallback, Object... args)
      Parameters:
      key - 国际化文本在 resource bundle 中的键值
      fallback - 兜底内容。注意,兜底内容不能包含参数。
      args - 消息格式化参数
      Returns:
      国际化消息