protected static void doDocumentReplacement(@NotNull PsiFile psiFile,
                                              UElement literalExpression,
                                              String i18nizedText,
                                              Document document,
                                              @Nullable UastCodeGenerationPlugin generationPlugin) {
    PsiElement psi = literalExpression.getSourcePsi();
    if (psi == null) {
      return;
    }
    Language language = psi.getLanguage();
    int startOffset = psi.getTextRange().getStartOffset();
    document.replaceString(startOffset, psi.getTextRange().getEndOffset(), i18nizedText);
    PsiDocumentManager.getInstance(psiFile.getProject()).commitDocument(document);
    if (generationPlugin == null) {
      return;
    }
    PsiElement notShortenPsi =
      CodeInsightUtilCore.findElementInRange(psiFile, startOffset, startOffset + i18nizedText.length(), PsiElement.class, language);
    shortenReferences(notShortenPsi, generationPlugin);
  }
protected static void doDocumentReplacement(@NotNull PsiFile psiFile,
                                              UElement literalExpression,
                                              String i18nizedText,
                                              Document document,
                                              @Nullable UastCodeGenerationPlugin generationPlugin)