Closed Bug 993296 Opened 11 years ago Closed 8 years ago

Article redirection don't take anchors in consideration

Categories

(support.mozilla.org - Lithium :: Localization, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: pascalc, Assigned: mdziewonski)

Details

(Whiteboard: p=3 u=user s=2015.12)

Simone, didn't we report this issue already on SUMO at some point?
Hi Francesco, you do remember correctly. We've already discussed this some time ago in the SUMO forum https://support.mozilla.org/it/forums/l10n-forum/709474 The problem is that anchors are automatically created by the TOC (Table of Contents) in all SUMO articles and there is no way (as far as I know) to create anchors others than the ones created by the TOC. So, while an article URL is resolved with its localized counterpart (e.g. https://support.mozilla.org/kb/learn-more-about-the-design-of-new-firefox) if you do not put any locale notation in the URL, anchors are not resolved as they take their name from the localized paragraph title. (I hope I have been clear enough.)
OS: Linux → All
Hardware: x86_64 → All
Whiteboard: p=? u=user s=2015.12
Priority: -- → P3
This is hard, because hashes are entirely client side. We have to build the right document on the server without knowing what the user is looking for. That means that the localized article needs to include the "correct" English anchor links. I can think of two ways of doing this. 1. Have localizers "tag" headers with the corresponding English header. This would probably require building some new wiki syntax, but that shouldn't be too hard. More difficult, this would require all localizers to edit articles to include these tags. 2. Guess at the tags. For most documents, we can assume the first header in the localized version corresponds with the first header in the English version, the second to the second, the third to the third and so forth. It would be easy for a localizer to break this: they could simply add or remove headings. That sounds like a reasonable thing for a localizer to do, so this is a fragile solution. However, I think it will cover the majority of the cases. I think the final solution is a mix of these two: automatically guessed anchors based on the order of headers, with the option to override it for localizers that change the headers. At first I think we should do #2. It will get us the most benefit, since it doesn't require any work from localizers. This probably means hacking into the wiki parser for articles with parents, being able to parse the headers out of documents, and inserting extra anchor tags. That sounds like 3 points. If we find this doesn't work in a lot of cases, we should add a way for localizers to override the headers, like option #1.
Whiteboard: p=? u=user s=2015.12 → p=3 u=user s=2015.12
> 1. Have localizers "tag" headers with the corresponding English header. This > would probably require building some new wiki syntax, but that shouldn't be > too hard. More difficult, this would require all localizers to edit articles > to include these tags. The old TikiWiki software used to have such a feature (or plugin). I personally see this as the easiest solution and it wouldn't be so hard to insert anchor tags in a few articles - I mean, in Summer 2012 we had to insert the "Share template" in 300 articles, after all.
Cleaning up old bugs before the migration. Redirects and deep linking are undergoing tests & this may be not relevant on the new platform.
Assignee: nobody → mdziewonski
Status: NEW → ASSIGNED
Flags: needinfo?(mdziewonski)
Priority: P3 → P2
Flags: needinfo?(mdziewonski)
Product: support.mozilla.org → support.mozilla.org - Lithium
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.