Skip to content

Commit

Permalink
Uses summary/details to show original strings
Browse files Browse the repository at this point in the history
  • Loading branch information
eliocamp committed Jul 12, 2024
1 parent ff65977 commit 25aa9d3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion R/rd-translate.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ translate <- function(original, translation) {
translation_exists <- !is.null(translation[[section]]$translation)

if (version_matches && translation_exists) {
original[[section]] <- translation[[section]]$translation
if (section %in% c("examples", "title")) {
original[[section]] <- paste0(
translation[[section]]$translation,
"\\if{html}{\\out{<details style='display:inline'> <summary>} 🌐 \\out{</summary>} ",
original[[section]]$original,
"\\out{</details>}}")
} else {
original[[section]] <- translation[[section]]$translation
}

} else {
# If the translation is out of date?
# For now, keep the original
Expand Down

0 comments on commit 25aa9d3

Please sign in to comment.