My code currently looks something like this:
<template>
<div>
{{ text }}
</div>
</template>
<script>
export default {
data: () => ({
text: 'Hello world'
})
}
</script>
I am trying to access the translated string for "Hello world" inside the script tag, but I'm not sure how to achieve that. I attempted the following:
<script>
export default {
data: () => ({
text: t('hello_world')
})
}
</script>
This t('hello_world')
function is supposed to fetch the translated string from another file where all translations are stored.