Skip to content

Commit d6dee12

Browse files
leave current language in, unlinked
Co-authored-by: Ricardo Demián Villalba <[email protected]>
1 parent d2cef04 commit d6dee12

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

vignettes/_translation_links.R

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@
1515
)
1616
transl_lang = ifelse(dirname(translation) == ".", "en", dirname(translation))
1717
block = if (!all(transl_lang == lang)) {
18-
sprintf(
19-
fmt, paste(collapse = " | ", sprintf(
20-
"[%s](%s)",
21-
transl_lang[transl_lang != lang],
22-
file.path(url, sub("(?i)\\.Rmd$", ".html", translation[transl_lang != lang]))
23-
)))
18+
linked_transl = sprintf("[%s](%s)", transl_lang, file.path(url, sub("(?i)\\.Rmd$", ".html", translation)))
19+
linked_transl[transl_lang == lang] = lang
20+
sprintf(fmt, paste(linked_transl, collapse = " | "))
2421
} else ""
2522
knitr::asis_output(block)
2623
}

0 commit comments

Comments
 (0)