test/com/google/javascript/jscomp/XtbMessageBundleTest.java
/**
   * When using EXTERNAL messages with plurals/selects, the XTB files may contain a mix of ICU style
   * placeholders (i.e. {@code {foo}}) and regular placeholders (i.e. {@code <ph name="foo"/>}).
   * However, JsMessage and the Closure Library runtime don't expect to see regular placeholders, so
   * they must be rewritten.
   */
When using EXTERNAL messages with plurals/selects, the XTB files may contain a mix of ICU style
placeholders  and regular placeholders .
However, JsMessage and the Closure Library runtime don't expect to see regular placeholders, so
they must be rewritten.
When using EXTERNAL messages with plurals / selects the XTB files may contain a mix of ICU style placeholders and regular placeholders . However JsMessage and the Closure Library runtime don ' t expect to see regular placeholders so they must be rewritten .
@Test
  public void testXtbBundle_mixedPlaceholders() throws IOException {
    InputStream stream = new ByteArrayInputStream(XTB_WITH_MIXED_PLACEHOLDERS.getBytes(UTF_8));
    XtbMessageBundle bundle = new XtbMessageBundle(stream, PROJECT_ID);
    assertThat(bundle.getAllMessages()).hasSize(2);
    assertThat(bundle.getMessage("123456").toString())
        .isEqualTo(
            "{USER_GENDER,select,"
                + "female{Hello {userIdentifier}.}"
                + "male{Hello {userIdentifier}.}"
                + "other{Hello {userIdentifier}.}}");
    assertThat(bundle.getMessage("123457").toString())
        .isEqualTo("{$startParagraph}p1{$endParagraph}{$startParagraph}p1{$endParagraph}");
  }
@ Test public void testXtbBundle_mixedPlaceholders ( ) throws IOException { InputStream stream = new ByteArrayInputStream ( XTB_WITH_MIXED_PLACEHOLDERS . getBytes ( UTF_8 ) ) ; XtbMessageBundle bundle = new XtbMessageBundle ( stream , PROJECT_ID ) ; assertThat ( bundle . getAllMessages ( ) ) . hasSize ( 2 ) ; assertThat ( bundle . getMessage ( "123456" ) . toString ( ) ) . isEqualTo ( "{USER_GENDER,select," + "female{Hello {userIdentifier}.}" + "male{Hello {userIdentifier}.}" + "other{Hello {userIdentifier}.}}" ) ; assertThat ( bundle . getMessage ( "123457" ) . toString ( ) ) . isEqualTo ( "{$startParagraph}p1{$endParagraph}{$startParagraph}p1{$endParagraph}" ) ; }
When using EXTERNAL messages with plurals/selects, the XTB files may contain a mix of ICU style
 placeholders (i.e.
When using EXTERNAL messages with plurals / selects the XTB files may contain a mix of ICU style placeholders ( i . e .
// Previous ICU message should not to affect next message