From bb862baba62725f67939bec8c5b423392bc63f1f Mon Sep 17 00:00:00 2001 From: Nils Lindemann Date: Fri, 22 Aug 2025 14:59:36 +0200 Subject: [PATCH] Intermezzo: Add a rule to the general prompt ..., which tells the LLM to fix wrongly translated anchor parts in links. Back in those days I translated these parts, to link to the correct German heading, which then had a different anchor than the English heading. But now, as we use the same anchors documentation-wide, this needs to be undone. The LLM missed some of these translated anchors, so I added this rule. I will check via script, when gone through the whole documentation, if all those anchor parts are in sync and valid. --- scripts/translate.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/translate.py b/scripts/translate.py index fffc87ecb..01284835e 100644 --- a/scripts/translate.py +++ b/scripts/translate.py @@ -181,6 +181,22 @@ Result (German): 5) Do not translate anchor fragments in links (the part after #), as they must remain the same to work correctly. +5.1) If an existing translation has a link with an anchor fragment different to the anchor fragment in the English source, then this is an error. Fix this by using the anchor fragment of the English source. + +Example: + +Source (English): + +[Body - Multiple Parameters: Singular values in body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank} + +Existing wrong translation (German) – notice the wrongly translated anchor fragment: + +[Body – Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#einzelne-werte-im-body){.internal-link target=_blank}. + +Result (German) – you fix the anchor fragment: + +[Body – Mehrere Parameter: Einfache Werte im Body](body-multiple-params.md#singular-values-in-body){.internal-link target=_blank}. + """ app = typer.Typer()