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

Cannot get translation dynamically by key #261

Open
DirtyNative opened this issue Nov 5, 2024 · 3 comments
Open

Cannot get translation dynamically by key #261

DirtyNative opened this issue Nov 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@DirtyNative
Copy link

I cannot access my translations via:

translations['my.key']

as the compiler tells me: The operator '[]' isn't defined for the type 'TranslationsUiEn'. Try defining the operator '[]'.

Within the documentation it is clearly stated like so. See this

Also found this thread:
#50

I am not sure if it is actually a bug, my stupidity, or that the package changed some things in previous versions and the documentation is not up to date anymore.

@DirtyNative DirtyNative added the bug Something isn't working label Nov 5, 2024
@Tienisto
Copy link
Member

Tienisto commented Nov 5, 2024

This is not the root variable. You have TranslationsUiEn but you need Translations/TranslationsEn

@DirtyNative
Copy link
Author

True, this was caused by a lot of try and error. The real error is The operator '[]' isn't defined for the type 'Translations'. Try defining the operator '[]'

@Tienisto
Copy link
Member

Tienisto commented Nov 6, 2024

Can you show me your config?

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