Skip to content

fix google cloud translate line break#1951

Merged
Tlaster merged 1 commit intomasterfrom
bugfix/google-cloud-translate
Apr 2, 2026
Merged

fix google cloud translate line break#1951
Tlaster merged 1 commit intomasterfrom
bugfix/google-cloud-translate

Conversation

@Tlaster
Copy link
Copy Markdown
Contributor

@Tlaster Tlaster commented Apr 1, 2026

No description provided.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 101bbf48ea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +734 to +737
if (!sourceText.contains('\n') || sourceText.contains("\n\n")) {
return translatedText
}
return translatedText.replace(Regex("\\n{2,}"), "\n")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Respect CRLF paragraph breaks when normalizing newlines

The guard here only treats "\n\n" as an existing paragraph break, so inputs that use Windows line endings (for example "\r\n\r\n") are misclassified as having no blank lines. In that case we enter normalization and collapse "\n\n" in the translated output to a single newline, which removes real paragraph breaks and changes document formatting for CRLF-origin text. This is a regression from the previous behavior, which left those paragraph separators intact.

Useful? React with 👍 / 👎.

@Tlaster Tlaster merged commit 7a30b3f into master Apr 2, 2026
9 of 10 checks passed
@Tlaster Tlaster deleted the bugfix/google-cloud-translate branch April 2, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant