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 script to setup translation fetching #14481

Merged
merged 2 commits into from
Dec 1, 2022

Conversation

bramkragten
Copy link
Member

Proposed change

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

script/bootstrap Outdated
@@ -8,3 +8,4 @@ cd "$(dirname "$0")/.."

# Install node modules
yarn install
script/setup_translations
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do that

Copy link
Member Author

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

Copy link
Member

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

Copy link
Member

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?

Copy link
Member Author

@bramkragten bramkragten Nov 30, 2022

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...

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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.

@steverep steverep merged commit 1a66b8a into dev Dec 1, 2022
@steverep steverep deleted the add-script-for-translation-fetching branch December 1, 2022 14:00
@github-actions github-actions bot locked and limited conversation to collaborators Dec 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants