@Test public void choiceFormat() { assertThat(format("{0,choice,0#zero|1#one|1<multiple}", 0)).isEqualTo("zero"); assertThat(format("{0,choice,0#zero|1#one|1<multiple}", 1)).isEqualTo("one"); assertThat(format("{0,choice,0#zero|1#one|1<multiple}", 2)).isEqualTo("multiple"); }
@Override public String format(final String message, final Object[] arguments) { try { return new MessageFormat(message, locale).format(resolve(arguments)); } catch (IllegalArgumentException ex) { InternalLogger.log(Level.WARN, ex, "Illegal message format pattern '" + message + "'"); return message; } }
JavaTextMessageFormatFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return new MessageFormat(message, locale).format(resolve(arguments)); } catch (IllegalArgumentException ex) { InternalLogger.log(Level.WARN, ex, "Illegal message format pattern '" + message + "'"); return message; } } }
JavaTextMessageFormatFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return new MessageFormat(message, locale).format(resolve(arguments)); } catch (IllegalArgumentException ex) { InternalLogger.log(Level.WARN, ex, "Illegal message format pattern '" + message + "'"); return message; } } JavaTextMessageFormatFormatter(final Locale locale); }
JavaTextMessageFormatFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return new MessageFormat(message, locale).format(resolve(arguments)); } catch (IllegalArgumentException ex) { InternalLogger.log(Level.WARN, ex, "Illegal message format pattern '" + message + "'"); return message; } } JavaTextMessageFormatFormatter(final Locale locale); @Override String format(final String message, final Object[] arguments); }
JavaTextMessageFormatFormatter extends AbstractMessageFormatter { @Override public String format(final String message, final Object[] arguments) { try { return new MessageFormat(message, locale).format(resolve(arguments)); } catch (IllegalArgumentException ex) { InternalLogger.log(Level.WARN, ex, "Illegal message format pattern '" + message + "'"); return message; } } JavaTextMessageFormatFormatter(final Locale locale); @Override String format(final String message, final Object[] arguments);  }