Open michaelmcmillan opened 4 years ago
Nice! Couple of questions:
Nice! Couple of questions:
- When and who runs the script? On PRs?
Not sure what's best. PRs would work
- Does it make sense to run it on all branches and all commits, or should we only run it on the current state on the branch you are on?
See comment above.
- Any reasons javascript is used instead of typescript?
Wanted to crank it out fast. Types can be added.
Great job, I think it will make it much easier to handle translations :)
Just tested this on @sbocinec's PR #483 and it seems to have worked 👍
Just tested this on @sbocinec's PR #483 and it seems to have worked 👍
![]()
Haha nice, also found this bug from looking at the picture: https://github.com/BustByte/coronastatus/commit/b2988f401286d0f54f3c9d7e2e65f37d81329f16
Although a few of the keys are not part of the translations anymore. Maybe add a whitelist or something where we can declare those?
Next step before it's ready to merge:
@michaelmcmillan hub (an extension to git) might be of use for fetching PRs.
The script is heavily commented with what I've been thinking. There might be a logical error here, so please read through the script to see if it makes sense.
This script will produce false positives (since it looks at all changes to the file ever). Why did I make it like that? Because translations are added at different points in time – a new feature branch will contain new translations, while all the existing branches and locales will be missing those.
This will produce some false positives (translations which have been removed etc.), but it in turn include translations which are being worked on right now in different branches (which should allow us to start translating before the PR is done, and widen the bottleneck which is currently halting PRs). We could also just add the false positives to an ignore list to make them go away.
I'm hoping this should make it easier for us to quickly grab all missing translations for all locales and then handing them off to a non-technical person that don't know JSON or git, maybe via. a more friendly medium like Google Sheets.
This is what I get if I run the script right now for no, en-IN and se.
no missing translation for: Sweden
... basically means that the Norwegian locale (no.json) has never had a row in its JSON file where the key is Sweden and the value is Sverige.Does this make sense? Haha, I'm actually not sure. Here's the full output: