dotnet-api-docs icon indicating copy to clipboard operation
dotnet-api-docs copied to clipboard

Translation Issue: Many fragment hyperlinks don't work in translated content

Open SetTrend opened this issue 1 year ago • 5 comments

Type of issue

Other (describe below)

Description

In translated content on learn.microsoft.com, fragment hyperlinks don't lead to their corresponding heading.

For example, visit this page in German: https://learn.microsoft.com/de-de/dotnet/api/system.text.regularexpressions.regex.replace

… and visit any fragment hyperlink in there.

Here's a non-functional example: https://learn.microsoft.com/de-de/dotnet/api/system.text.regularexpressions.regex.replace?view=net-9.0#system-text-regularexpressions-regex-replace(system-string-system-string)

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.replace?view=net-9.0#system-text-regularexpressions-regex-replace(system-string-system-string)

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Text.RegularExpressions/Regex.xml

Document Version Independent Id

16e735bf-9c96-3a28-ab98-b0cf74c38a97

Article author

@dotnet-bot

SetTrend avatar Nov 26 '24 00:11 SetTrend

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

ghost avatar Nov 26 '24 00:11 ghost

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

ghost avatar Nov 26 '24 00:11 ghost

cc @dotnet/area-system-text-regularexpressions

ViktorHofer avatar Dec 03 '24 13:12 ViktorHofer

I'm not seeing the problem. When I click the method overloads, they take me to the correct section of the page. Can you elaborate on the issue?

gewarren avatar Dec 04 '24 19:12 gewarren

@gewarren:

I did some research and noticed that the issue is based in Microsoft Learn displaying a footer. The footer is scrolling the target out of the viewport:

I Image

If you scrutinize the above screencast, you will notice that the footer is only displayed in the Firefox webbrowser, but not in MS Edge.

Strange …

SetTrend avatar Dec 10 '24 23:12 SetTrend

I logged an internal work item to track this. Unfortunately it was closed without further action. But I did get some info that helps to explain what might be happening:

This is liable to happen on pages with dynamic content, which is exactly what zone pivots are. What happens is that the browser scrolls to the anchor before the dynamic content finishes loading and rendering completely, and the last rendering steps end up growing or shrinking the content such that the viewport gets moved. This is why it only happens on the initial load of a page with an anchor in the URL and not when clicking the "in this article" links after the page has fully loaded.

I don't think there's anything you can do in the content to reliably fix this short of not using controls like zone pivots. A full solution would require something in platform rendering to perform anchor scrolling on page load more reliably.

gewarren avatar Sep 30 '25 18:09 gewarren