ropensci-review-tools / babeldown

Helpers for Automatic Translation of Markdown-based Content
https://docs.ropensci.org/babeldown/
Other
21 stars 2 forks source link

crossreferences can be translated or not #64

Closed xtimbeau closed 7 months ago

xtimbeau commented 8 months ago

Sometimes cross ref are translated, sometimes not.

---
title: "crossref"
description: "comment protéger les références croisées dans quarto et babeldown ?"
---

Imaginons une référence croisée à un chapitre qui suit. 

La référence n'est pas protégée quand elle est mise @sec-chapitre ou sous la forme [@sec-chapitre],
mais @sec-chapitre2 est protégée.

## Le chapitre suivant {#sec-chapitre}

## un autre chapitre {#sec-chapitre2}

is translated from french to english as (note the @sec-chapter):

---
title: crossref
description: how do you protect cross-references in quarto and babeldown?
---

Let's imagine a cross-reference to a chapter that follows.

The reference is not protected when it is put in @sec-chapter or in the form [@sec-chapter],
but @sec-chapitre2 is protected.

## The next chapter {#sec-chapitre}

## another chapter {#sec-chapitre2}

A way is to add some number to all cross-refs, but I think there is another solution ?

maelle commented 7 months ago

Right, they should never get translated automatically, I'll have to explore.

maelle commented 7 months ago

Related: #49

maelle commented 7 months ago

oh I found the bug! In protect_squaries() I did not account for the possibility of hyphens!

Thanks so much for your contributions & patience @xtimbeau, this is really making the package better. :pray:

xtimbeau commented 7 months ago

thanks to you!

Le ven. 5 avr. 2024 à 11:59, Maëlle Salmon @.***> a écrit :

oh I found the bug! In protect_squaries() I did not account for the possibility of hyphens!

Thanks so much for your contributions & patience @xtimbeau https://github.com/xtimbeau, this is really making the package better. 🙏

— Reply to this email directly, view it on GitHub https://github.com/ropensci-review-tools/babeldown/issues/64#issuecomment-2039384164, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANA2KEKOYAC3LRTBGWXPT4TY3ZYXNAVCNFSM6AAAAABFQQCLNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZZGM4DIMJWGQ . You are receiving this because you were mentioned.Message ID: @.***>