... making a few fixes/changes:
* Fix a deprecation warning
* Fix a probably not intended hardcoded "es" language identifier when calling `translate_page`
* Fix `iter_en_paths_to_translate` and `non_translated_sections ` to also work on Windows, which uses backslashes in stringified paths
* Add `mode`, `verbose` and `preview` parameters to `translate_lang`, add a helper function to print path infos, and improve its output to show the progress.
* Add documentation to some function parameters
This commit started as an attempt to handle translation of abbr elements, which I was not able to get to work in a clean way. Shortly before I resigned I had the idea to try `openai:gpt-5` as agent in the translate.py, instead of `openai:gpt-4o` and BAM it worked. A lot of other things also worked much better. Modifications had to be made though because GPT-5 interpreted some rules stricter, so some reformulation and some more examples were needed. Will translate with that agent in the remaining translations to test if these prompts work well.
As it did so once (like in the example). This is actually super smart, the anchor exists (is the LLM caching the Anchors of headings in other documents?!), but I guess this possibly creates confusion, so avoid.
..., 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.
In this document it added language codes to urls starting with "https://sqlmodel.tiangolo.com/", resulting in broken links.
So I changed the instructions in the translate.py, so that it only adds the language code when the URL starts exactly with "https://fastapi.tiangolo.com".