-
Hi, I know this would kill the whole purpose of the typesafe thing, but is there a way to retrieve translations by a . separated string? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Hi, currently it is only possible to access the translations via an object-syntax. So each part has to be split on the '.' character. For dynamic attributes like the month, you need to use the Hope this answers your question. |
Beta Was this translation helpful? Give feedback.
Hi, currently it is only possible to access the translations via an object-syntax. So each part has to be split on the '.' character. For dynamic attributes like the month, you need to use the
[]
syntax.Your example looks right 👍
With dynamic values you could probably get type-errors so you will need to cast it. If
item. month()
returns anumber
but your translation will only contain values ranging from1 - 12
you will need to write it like this:LL.months[item.months() as any]()
.Hope this answers your question.