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

uk translation causing errors in admin sites (GenericApp.js:119 Uncaught TypeError: Cannot convert undefined or null to object) #1095

Open
stevenengland opened this issue Feb 20, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@stevenengland
Copy link

Hi there,

a newly created adapter using npx @iobroker/create-adapter@latest with

    "adminUi": "react",
    "tabReact": "yes",

creates adapter files using uk translations in admin/src/app.tsx and admin/src/tab-app.tsx

Currently this will cause a mismatch when the translations from GenericApp, which do not contain the uk entry, are mapped against each other.
grafik

The error thrown is then GenericApp.js:119 Uncaught TypeError: Cannot convert undefined or null to object.

@AlCalzone
Copy link
Collaborator

We'll need to replace @iobroker/adapter-react with @iobroker/adapter-react-v5 and possibly modify the templates a bit if something needs changing.
Would you be willing to help with that? Knowing what exactly needs to be changed where would be good.

@AlCalzone AlCalzone added the bug Something isn't working label Feb 20, 2024
@stevenengland
Copy link
Author

Hi @AlCalzone ,

I would like to help but I am not quite sure how to do so best because I do not know a lot about the differences between the adapter-react and adapter-react-v5 version :)

If uk shall be supported: Then maybe all that is to do is to add the key uk in the adapter-react version here: https://github.com/ioBroker/adapter-react/blob/259cd1f2a7ee5b19067d1ab2582ea05ea64d3575/src/GenericApp.js#L116

If uk shall NOT be supported right now, the uk entry should be removed in these files (my actual workaround to get the adapter admin working):

@stevenengland
Copy link
Author

Indeed adapter-react-v5 has the uk entry already in the list of languages. But I really have no clue if switching to v5 has some other implications. Therefore I am too new to the topic :)

@stevenengland
Copy link
Author

Oh, now I think I know, what you mean @AlCalzone There is quite a huge list that needs to be tackled to switch to v5, at least this is what the developers say...
https://github.com/ioBroker/adapter-react-v5/?tab=readme-ov-file#migration-from-adapter-react-to-adapter-react-v5

You mean that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants