@ VisibleForTesting static String buildMsgContentStrForMsgIdComputation ( ImmutableList < SoyMsgPart > msgParts , boolean doUseBracedPhs ) { msgParts = IcuSyntaxUtils . convertMsgPartsToEmbeddedIcuSyntax ( msgParts ) ; StringBuilder msgStrSb = new StringBuilder ( ) ; for ( SoyMsgPart msgPart : msgParts ) { if ( msgPart instanceof SoyMsgRawTextPart ) { msgStrSb . append ( ( ( SoyMsgRawTextPart ) msgPart ) . getRawText ( ) ) ; } else if ( msgPart instanceof SoyMsgPlaceholderPart ) { if ( doUseBracedPhs ) { msgStrSb . append ( ' ' ) ; } msgStrSb . append ( ( ( SoyMsgPlaceholderPart ) msgPart ) . getPlaceholderName ( ) ) ; if ( doUseBracedPhs ) { msgStrSb . append ( ' ' ) ; } } else { throw new AssertionError ( "unexpected child: " + msgPart ) ; } } return msgStrSb . toString ( ) ; }
Private helper to build the canonical message content string that should be used for msg id computation .