Access messages from js in Vue3 #967
Unanswered
michalroxorpl
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am facing a difficulty with specific type of access to localized messages array / object.
In my Vue3 application I would like to iterate through the subnodes of translated texts, the structure looks like this:
Since I know how many subnodes there are (3 in the example) I can use this approach:
Right now if the quantity of subnodes changes I need to modify the source code, what I would like to achieve is some kind of measurement telling the code how many subnodes exists, f.e.
nodes.length
would give me the expected value.How can I programmatically access messages imported into vue-i18n-next to be able to work with the translated texts as an object accessible from js / Vue3
<script />
block?This is how I am invoking the i18n support in my Vue3 application:
PS: I am so happy you are investing your time in this great project, thank you for this effort guys.
Beta Was this translation helpful? Give feedback.
All reactions