-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 command to scan for new translation #5168
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please factor code out of the 'Translate' method? 120 lines seems very long for something that could be broken down. That would also facilitate adding a test :).
Lastly do note to check the boxes on your PR template so we can see where it's at
Just FYI we have now update the CI version requirements so you'll need to rebase on latest develop to get a full build to pass |
…d document, make verbose mode more useful, and split into smaller pieces
748a043
to
2958668
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a few logic glitches which I commented inline.
However the biggest comment would be that we avoid code comments unless really required. More often than not an inline comment shows a lack of clarity in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty epic. Just continuing a comment from before.
Those Windows errors seem to indicate you haven't closed a file before trying to remove it. |
Sort of like that. The problem was doing chdir into the temp directory in the test as it prevents removal. |
Did I miss the comment or was it addressed? I'm not sure at the moment. |
Unfortunately force-pushing after a review often kills comments - GitHub has an habit of losing them so we ask folk not to force after first review. It all looks good though thanks - I will run some tests but pretty excited to see this added! |
Thanks so much, I tried this out but I think it doesn't create the folder if it doesn't exist.
My first attempt was to pass a directory but it didn't work - should it? :) Last comment. Our translations were 2 spaces, weblate default is 4 spaces and this is tabs. |
…uments instead, and improve wording in command description
… to avoid dealing with file name and location
That's not a nice experience. Changed it.
Absolutely, and it does now :)
Since we use weblate I've changed it to 4 spaces. |
…confusing errors when accidentally using it on other files
Additionally it's now checking the first argument:
|
Why make the translations file a mandatory argument you ask?
|
Apologies for the delay. I have tried this latest version but can't seem to figure it out.
But I see no output at all - any idea what I am doing wrong? When I ran it without --dry-run it re-added the translation as expected. |
You're doing it right. I think |
Description:
Adds a translate command that scans for new translation and updates the translations file.
No new external modules are imported.
The resulting size increase for the fyne command binary is 830kb on this version of macOS:
Checklist:
Where applicable: