Is there a way to translate a page after api responded and page is fully rendered? #19
-
I am trying to use this package in a SPA vue app. I want to achieve translation after i get response from my api. Is it possible to do so, or it is limited to static pages only? |
Beta Was this translation helpful? Give feedback.
Answered by
i7eo
Aug 12, 2022
Replies: 1 comment 2 replies
-
This library supports dynamic translation. Because <template>
<div id="app" class="notranslate" ref="app">
<button @click="handleAsyncTranslate">Async Test</button>
<v-google-translate />
</div>
</template>
<script>
export default {
name: "App",
methods: {
handleAsyncTranslate() {
const appEl = this.$refs.app
if (appEl.classList.contains("notranslate")) {
appEl.classList.remove("notranslate");
}
}
},
};
</script> |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
greatmaxix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This library supports dynamic translation. Because
Google translate sdk
provides class namenotranslate
to avoid translation.You can try as follows: