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

Expose translationMetadata so we can retrieve the language files #20769

Open
4 tasks done
shannonhochkins opened this issue May 10, 2024 · 4 comments
Open
4 tasks done

Comments

@shannonhochkins
Copy link

shannonhochkins commented May 10, 2024

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

Currently, the front-end retrieves a lanaguage file to populate fields in the UI - from this url /static/translations/en-c907c791db816c05eb6bad244e22784a.json obviously the hash in this url is dynamic and currently there's no way to fetch these for an addon so we don't have to copy these translations again down into the addon directly which i see time and time again with custom integrations.

I poked around in the frontend code and noticed there's a translationMetadata object which is used to retrieve the hash and this is populated at build time, it would be great to expose this somehow so that custom addons / external addons have the ability to utilize the work already gone into generating these locales.

Describe the behavior you expected

It would be great if we could expose the translationMetadata object to the client so we can manually fetch the language file ourselves

Steps to reproduce the issue

No real steps to reproduce this issue, it's simply unavailable and bundled within the app.js code

What version of Home Assistant Core has the issue?

2024.5.0

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Unrelated

Which operating system are you using to run this browser?

Unrelated

State of relevant entities

NA

Problem-relevant frontend configuration

NA

Javascript errors shown in your browser console/inspector

NA

Additional information

I think simply allowing this websocket call to allow "ui" as a category would be very beneficial!

@karwosts
Copy link
Contributor

Frontend repo is not the right place for asking about changes to a websocket API, core implements those.

That said I believe that is only for core translations. Translations in the frontend repo (like ui.common.close), I don't see how core could serve those since they are not present in the core repo, but I'm not super knowledgeable on that.

@karwosts karwosts closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
@shannonhochkins
Copy link
Author

@karwosts I didn't just ask about the websocket api, i also asked for the translationMetadata to be exposed so that we can fetch the file ourselves - Can you please reopen this?

@karwosts
Copy link
Contributor

I still don't think this is the right place for this request, but I'll let it go for now.

@karwosts karwosts reopened this May 16, 2024
@shannonhochkins
Copy link
Author

I'll re-phrase the question to suit the frontend

@shannonhochkins shannonhochkins changed the title Expose translationMetadata or UI translations from frontend/get_translations Expose translationMetadata so we can retrieve the language files May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants