Skip to content

Conversation

@maelle
Copy link
Contributor

@maelle maelle commented Jul 15, 2025

The plan is for me to use this branch when working on the dev guide release @mpadge.

The big limitation of both update functions is that

  • they rely on the XML structure to be the same to start with. So we can't split a paragraph in a translation or add a translation note outside of the paragraph.

New functions

  • deepl_branch_update() that uses a configuration file and the commits in a branch/PR to update the documents in other languages.
  • deepl_translate_clipboard() that reads from the clipboard and can even guess the source language. Super useful when you know what you need to update/add and where.

Improvements that this PR brings to the updating functions

  • re-use list items for the list at the first level (so it doesn't re-use items of nested lists)
  • only re-writes the lines that have been changed.

@@ -0,0 +1,11 @@
cli_alert_success <- function(text, .envir = parent.frame()) {
if (!getOption("babeldown.quiet", FALSE)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mpadge look at me following part of our blog post's advice 😇

source_lang,
target_lang,
formality = c("default", "more", "less", "prefer_more", "prefer_less")) {
#' Translate Markdown string from clipboard
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the new stuff in this file!

#' but containing edits to the source file, like typo fixes,
#' too much of the target file will be translated automatically again.
#'
#' @section Configuration for `deepl_branch_update()`:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mpadge this explains the configuration

)
}

deepl_part_translate <- function(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this needs a better name

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.

2 participants