New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link to correct line when editing a translation #1075
Comments
How can I reproduce this issue?? |
Try clicking the little pencil in the top-right corner of a translation. It will take you to the |
Try with this page: https://google.github.io/comprehensive-rust/pt-BR/running-the-course.html |
Is this that thing?? Screen.Recording.2023-11-02.at.8.05.00.AM.mov |
Yes, precisely! If you use the pencil on one of the English pages, then you're taking to the correct Markdown file in GitHub. However, if you do it on a translated page (like in your video), then you're taking to the huge PO file instead. That's not very useful for people who want to submit fixes to the translations. |
Got it lemme figure out something and raise a pr for this issue... Thanks for clarification |
On a whim, I tried adding a
#Lnnn
fragment to a URL which opens the GitHub code editor... and it works! Check out line 3456 of the Korean translation.With this, we are able to create useful links on the published pages for the translations. Currently, we simply link to the
xx.po
file, but we should instead link to the first message of each page. We could do so in a few different ways:xx.po
file, get the line number, inject the line number into the link on the page.We could go with a hybrid version: generate and publish a small
xx.json
file with the correct line number for every path. Then download this file when clicking the link. That ought to be fairly simple since it's easy to load JSON files from JavaScript, and it will be pretty simple to produce this file when we publish the course.Implementing this would drastically improve the editing experience for our translators.
The text was updated successfully, but these errors were encountered: