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

Dynamic key access to translations #51

Open
ShiroYacha opened this issue May 31, 2021 · 1 comment
Open

Dynamic key access to translations #51

ShiroYacha opened this issue May 31, 2021 · 1 comment

Comments

@ShiroYacha
Copy link

Hi,

There are some use-cases (e.g. translations for enum types) where I need to access a dynamic key in runtime. I wonder if this can be achieved with the library without written mapping code in the client? At the moment I am using a workaround where I put the translations as map in a row, and do a runtime check and apply the items, e.g.

key: | en
enum.fruits | {"apple": "Apple", "banana": "Banana", "default": ""...}

But it is not very scalable compared to define "apple", "banana" as separate rows.

@mboe
Copy link

mboe commented Jun 9, 2021

I think this is the same feature request as mine: #38 (comment)

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