code: private void buildReplacementNodesFromTranslation(MsgNode msg, SoyMsg translation) {
  
      currReplacementNodes = Lists.newArrayList();
  
      for (SoyMsgPart msgPart : translation.getParts()) {
  
        if (msgPart instanceof SoyMsgRawTextPart) {
          // Append a new RawTextNode to the currReplacementNodes list.
          String rawText = ((SoyMsgRawTextPart) msgPart).getRawText();
          currReplacementNodes.add(
              new RawTextNode(nodeIdGen.genId(), rawText, msg.getSourceLocation()));
  
        } else if (msgPart instanceof SoyMsgPlaceholderPart) {
          // Get the representative placeholder node and iterate through its contents.
          String placeholderName = ((SoyMsgPlaceholderPart) msgPart).getPlaceholderName();
          MsgPlaceholderNode placeholderNode = msg.getRepPlaceholderNode(placeholderName);
          for (StandaloneNode contentNode : placeholderNode.getChildren()) {
            // If the content node is a MsgHtmlTagNode, it needs to be replaced by a number of
            // consecutive siblings. This is done by visiting the MsgHtmlTagNode. Otherwise, we
            // simply add the content node to the currReplacementNodes list being built.
            if (contentNode instanceof MsgHtmlTagNode) {
              currReplacementNodes.addAll(((MsgHtmlTagNode) contentNode).getChildren());
            } else {
              currReplacementNodes.add(contentNode);
            }
          }
  
        } else {
          throw new AssertionError();
        }
      }
    }
docs: Private helper for visitMsgFallbackGroupNode() to build the list of replacement nodes for a
  message from its translation.