Skip to content
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

Add check if commands of translated pages are different #10

Open
marchersimon opened this issue Apr 26, 2021 · 9 comments
Open

Add check if commands of translated pages are different #10

marchersimon opened this issue Apr 26, 2021 · 9 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@marchersimon
Copy link

marchersimon commented Apr 26, 2021

Additionally to checking if translated pages have a different number of examples, it would be awesome to show if the examples itself are outdated. This could be done by extracting all commands (basically lines starting and ending with ` and removing all {{...}} from them. The output of this operation should look the exact same on every translated page of a command.

If a page has a different number of examples, that could be indecated with a ⚠ with red background and if the examples differ, with a ⚠ with yellow/orange background.

Edit: Actually replacing {{...}} with a default like {{argument}} instead of removing it would be better because then command wouldn't be the same as command {{...}}

@lukbukkit lukbukkit added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Apr 27, 2021
@bl-ue
Copy link
Contributor

bl-ue commented May 10, 2021

Also, what about translated variables? It might always be a false positive, because, for example, echo 'Hello world!' will always be different from echo '¡Hola mundo!'.

@marchersimon
Copy link
Author

We could also remove the contents of '...' and "...".

@lukbukkit
Copy link
Member

So in summary

  • we replace the content of {{...}} with generic content like {{argument}}
  • we replace the content of '...' and "..." with generic content like 'argument' and "argument"
  • then we compare those abstract commands of the base page with each translated page

Should we mark a page outdated if the abstract commands are the same as the one on the base page but aren't in the same order?

@bl-ue
Copy link
Contributor

bl-ue commented Jun 4, 2021

I think instead of {{argument}} and 'argument' we could use {{}} and ''.

Should we mark a page outdated if the abstract commands are the same as the one on the base page but aren't in the same order?

Probably.

@sebastiaanspeck
Copy link
Contributor

Is this still something someone is working on? The number of examples doesn't say that much about being outdated, the contents of the commands do

@lukbukkit
Copy link
Member

Hi, the issues is currently not being worked on but feel free to create a pull request to implement a better soluton. I don't have resources myself to create a soluton right now, maybe I can find time next year.

@sebastiaanspeck
Copy link
Contributor

In another tldr-repo, we achieved this (in Bash).

@lukbukkit
Copy link
Member

Okay that's awesome. I'll put the task for reimplementing on my ToDo list but it may take one or two months until I find some time.

@sebastiaanspeck
Copy link
Contributor

Okay that's awesome. I'll put the task for reimplementing on my ToDo list but it may take one or two months until I find some time.

If I had experience with Go, I'd probably would've worked on it, but I guess the Bash-example is a good start. In fact it is just removing all text in the commands that can be translated ({{...}}, <...>, (...), "...", and '...') and create one large string of all commands and compare those strings with each other (English with the one from the translated page).

If you need any help, please let me know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants