ravynsoft / ravynos

A BSD-based OS project that aims to provide source and binary compatibility with macOS® and a similar user experience.
https://www.ravynos.com
Other
5.66k stars 191 forks source link

Remove localization links in README #307

Open mszoek opened 2 years ago

mszoek commented 2 years ago

We currently have a growing set of translated READMEs which are all linked from each other. This is getting unmanageable as the list grows - already some files do not link to all the others. Let's remove these links and find a better way

ghost commented 2 years ago

What solution are you proposing?

mszoek commented 2 years ago

Maybe removing all the links from each file and letting people find the translated READMEs in the file list.

prolixalias commented 2 years ago

So, this suggestion is going in the opposite direction you'd envisioned @mszoek -- but I think I could probably make some sort of template and auto-generate what's mocked up here for the sake of discussion. Is that at all useful? Should I give it another shot?

mszoek commented 2 years ago

That actually looks fantastic! How is it generated?

prolixalias commented 2 years ago

Thanks! Only a mock-up there, to communicate what I was thinking... Didn't want to potentially waste time researching templating engines if there wasn't interest.

Will get a script of some kind together and submit a PR to your repo sometime soon.

prolixalias commented 2 years ago

DISCLAIMER: I'm an automation person by trade, not a developer... Had to assess what the best way(s) might be and made decisions (like choosing node) that may expose my novice. Likewise, had to learn node on the fly to get demo created. It's probably sub-optimal. Please keep that tidbit in mind when considering this approach. :)

Wasn't able to get a PR baked, like I thought, since some collaboration and feedback is needed.

However, this branch has a fully-working demo inside. Resulting single README is placed in root of repo. The other translations are generated and placed in i18n/rendered directory. To add a language:

I'd set it up with intention of having a github action trigger README rendering when a push to 'docs' branch occurs. Then, submit a PR at the end. That way, the project could potentially build on the concept by introducing other (than READMEs) auto-generated docs. Last part is a WIP as we'd need to discuss placing a token in your secrets.

Please let me know if you'd like to discuss and/or have a PR submitted back.

prolixalias commented 2 years ago

Also worth mentioning, decided on node as I assumed that would "cast the widest net" for other folks to maintain. Same thought process by feeding script with a json file. The main concern I have was nested forEach - but couldn't come up with anything more elegant with limited knowledge. Any suggestions are welcome, this has been a great learning exercise.

mszoek commented 2 years ago

OK... thanks for the detailed explanation here! Node is good.Shell scripts or Makefile would also be good options.

So, I like the end result and I have some concerns about the method of getting there. Needing to push to a branch which then builds and 'git adds' the new translation is not ideal. Could we have something like: you add a new translated README and a commit hook rebuilds the links in your local tree and adds all those updated files to the commit? Then when they do the PR, it is a complete unit, ready to merge.