-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 script to setup translation fetching #14481
Conversation
script/bootstrap
Outdated
@@ -8,3 +8,4 @@ cd "$(dirname "$0")/.." | |||
|
|||
# Install node modules | |||
yarn install | |||
script/setup_translations |
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.
I thought the goal was to use English only builds, unless the developer specifically wanted to fetch the translations?
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.
We can do that
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.
btw, last nights build failed with the new fetch translation script, do have time to check that? https://github.com/home-assistant/frontend/actions/runs/3579496844
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.
I'll take a look
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.
There's a problem with the backend translations. I noticed this before but the error is new. There are both en-GB.json
and en_GB.json
being downloaded, but only the underscore version is populated, which the gulp task ignores. So the error is about reading an empty file.
Seems like it's either a core issue or a Lokalise issue with the backend project?
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.
That's weird, they seem to be the same in frontend and core...
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.
Ah, probably because nothing is translated in core
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.
So for some reason the existsSync
check is failing when the file is empty even though it does exist. That method is deprecated in node.js anyway, so we should fix by wrapping the write in a try/catch.
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.
no, the files dont exist in core, they do in frontend
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.
Oh... that makes more sense. 💡
The fix is the same though. It won't write because exists didn't fully close it yet (which is why it was deprecated). I'll push a fix shortly but I cannot fully test since I can't download from the backend project.
Proposed change
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: