What is the merit of having heading IDs translated per localization? #11181
Replies: 5 comments 7 replies
-
In our case we chose this mainly for ease of maintenance — using English IDs in non-English pages introduces quite a lot of extra work (for example, every translated heading would need to make sure it also includes an explicit heading ID, and then those would need to be kept in sync somehow with the English — or the English would also need explicit heading IDs). That’s a lot to juggle for contributors and would also require more CI tooling to ensure IDs are always valid. We didn’t see a clear benefit to justify all that effort. |
Beta Was this translation helpful? Give feedback.
-
What you are pointing out is not a problem.
Just leave the hash fragment untranslated. Page B falls back to English version. The problem is it causes dependencies between translated pages. If page B gets translated in the future, we'll need to modify page A together to update the link. If page A is outdated at that time, we'll also need to update it to date. |
Beta Was this translation helpful? Give feedback.
-
I haven't intervened before because I'm happy with the current process, but if it helps, here's my reaction to your thoughts.
I started translating the docs in French less than a year ago and the process seems quite simple to me so I don't necessarily see any improvement to be made. Certainly, managing links can be problematic but I don't have a better solution.
This is only true when the file is very outdated and many commits have occurred between the English version and the translation. Otherwise, with Git Diff, it's quite easy to check what has changed. But I understand that this can be problematic. Personally in such a case, I just use the English file and compare line by line in my IDE to see if that's match. Perhaps it takes a bit more time but I'm not bothered by that.
A dictionary is an interesting idea when certain strings repeat in exactly the same way, but it seems to me that this is more or less what is already done with There are also the I think a dictionary for sentences could introduce other problems. Sometimes the same set of words could be translated in another way according to the context.
Well, if the English version is updated, the translation should be updated as well. From the dashboard, you can view the commit list to verify the changes. So I'm not sure I understand the issue here...
If you use VS Code, I believe the
I have to admit that this is the most complicated point when the translation is not up to date or there are big changes related to a version change (e.g. the v5 release). And I don't have any solutions to solve this issue either. For the French translation, we managed to get by. But, yeah, it's not "easy".
In between, I use the dev server to check the rendering and update the links. When there are link issues... well, I handle them on a case-by-case basis. Often, if I know I'm going to be working on the linked page that's causing the issue, I remove the anchor and put it back when I translate the other page. I'm confident with this process because I keep track of these issues and I follow the PRs made in my language and I can alert the author PR if the translation has been made by someone else. So, I'm not saying this is a solution for others, but it works for me.
To be honest, I'm not convinced here. Looking at (3) I feel like it will be harder to follow the changes made in the English version... IMO, this solution adds noise and we can no longer rely on line numbers when looking at git diffs. Maybe if I saw this process in action I would have a different idea. But right now, I'm having trouble seeing the point. I think it's easier to have everything in the same language to make sure that each paragraph is consistent with each other. But that's just my opinion.
Yeah, it's not ideal with some alphabets. But I'd say this is more a browser issue... Using the English ID could maybe be a better translator experience but I don't think this a better user experience. Ideally, I think links should be fully translated, so anchors (ids) as well. But my opinion may be biased in relation to my alphabet. |
Beta Was this translation helpful? Give feedback.
-
If we can't have English IDs because of maintenance burden, can we come out with alternative solutions to this problem? Like limit link checks in CI? Or create a field in frontmatter of translation to declare a corresponding English doc version like what MDN does ( |
Beta Was this translation helpful? Give feedback.
-
It does, but we have tests to check for this! When this happens, checks don't pass and we fix them. So, it's not really a problem in that we know when it happens, and how to fix it. This is simpler to maintain than every model we've thought about for not localizing the headings. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
For example, the following URL is available:
The URL to access the same section in the Japanese localized version is as follows:
Since they point to the same section, doesn't it make sense that even the localized version should be accessible at the following URL?
Why do you use different heading IDs for the English and localized versions?
I found the following pull request and I agree with the policy of such a modification. #9346
For reference, a similar discussion is also taking place at MDN. Translation of IDs of headings
I would like to seek your views on this.
Beta Was this translation helpful? Give feedback.
All reactions