php / web-doc

http://doc.php.net
33 stars 84 forks source link

Improve Diff Viewer #29

Closed lhsazevedo closed 2 years ago

lhsazevedo commented 2 years ago

Preview

Preview image

Intro

Improve the usability of the diff viewer with:

Now you can copy only the contents, without diff markers or line numbers:

https://user-images.githubusercontent.com/7695608/147865371-16fbb0d4-9f33-4728-a515-514cdf6c915c.mp4

The grayscale version was updated as well Colorless preview

Animated comparison: diffviewer2

@nilgun As the last PRs were implemented in a separated commit, if you accept this one, would you mind adding me as co-author or author of your commit? Thanks in advance :)

nilgun commented 2 years ago

The line numbers of the translation are not usually the same as the line numbers of the original document. Therefore, this change cannot go beyond being cosmetic.

Lucas Henrique @.***>, 2 Oca 2022 Paz, 07:34 tarihinde şunu yazdı:

Preview

[image: Preview image] https://user-images.githubusercontent.com/7695608/147865259-681aa57e-922c-4981-a931-608d33ab0166.png Intro

Improve the usability of the diff viewer with:

  • Line numbers on every line
  • Unselectable diff markers
  • Updated look

Now you can copy only the contents, without diff markers or line numbers: diffviewer1-new.mp4

The grayscale version was updated as well [image: Colorless preview] https://user-images.githubusercontent.com/7695608/147866105-8edb07fd-e67e-4a61-b31e-f7f8b98ceda2.png

Animated comparison: [image: diffviewer2] https://user-images.githubusercontent.com/7695608/147865614-89bfdb47-3f57-41e2-8b7a-16a99967946a.gif

@nilgun https://github.com/nilgun As the last PRs were implemented in a separated commit, if you accept this one, would you mind adding me as co-author https://docs.github.com/pt/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors or author https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---authorltauthorgt of your commit? Thanks in advance :)

You can view, comment on, or merge this pull request online at:

https://github.com/php/web-doc/pull/29 Commit Summary

File Changes

(1 file https://github.com/php/web-doc/pull/29/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/php/web-doc/pull/29, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSQAZUDLFU22WNQIL6CYZDUT7IVBANCNFSM5LDHMY2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

lhsazevedo commented 2 years ago

Thanks for your review.

Actually our line numbers (pt_br translation) are the same as the original document. We found out that matching lines numbers helps a lot when updating and reviewing translated files.

Here's an snippet from our style guide¹:

English sources: Please aim to keep lines in an XML file around 80 characters long or less. This is a loose requirement and 100 is probably acceptable as a maximum length. This aids in keeping diffs simple, which is particularly useful for translators, so follow this rule carefully.

Translated sources: In translations another style is suggested. Try to make the translated file have the same number of lines as the original file. In particular, that the lines contain almost the same tags on the same lines, even if the lines are longer than the original text. This is because English is a very succinct language, so translated lines tend to be much longer. Keeping the same number of lines, and tags almost on the same lines between original and translation help enormously in the translation update process, which is most of the effort.

So it would be really useful for us, in addition to having the familiar diff style of the big version control service providers (GitHub, GitLab, BitBucket etc).

1: https://github-com.translate.goog/php/doc-pt_br/wiki/Guia-de-edi%C3%A7%C3%A3o-do-manual?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=pt-BR#guia-de-estilo