Text is not translating after I remove notranslate
class
#20
-
So I followed steps you described in this discussion: #19 I have placed v-google-translate component in the navbar component of my app: <v-google-translate
@select="changeLang"
:languages="languages"
dropdownClassName="dropdown-menu-right"
fetchBrowserLanguage="false"
defaultLanguage="en"
/> In the mounted hook of the App.vue component I expire googtrans cookie: document.cookie = 'googtrans' + '=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;' And in my other component where I make a http request to server I am displaying car.name, which I want to translate: <div id="carName" class="col xyz-nested notranslate">
{{ car.name }}
</div> And after I got the response from the server I remove notranslate class from the element: .then((response) => {
this.car = response.data
})
.finally(() => {
this.loading = false
document.getElementById('carName').classList.remove('notranslate')
}) And unfortunately the car.name is not translated :( <div data-v-2b282e00="" id="carName" class="col xyz-nested"> 雅阁 2016款 2.0L 舒适版 </div> What did I miss? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
alright I'll try it first and then give you an answer |
Beta Was this translation helpful? Give feedback.
-
Sorry bro, When writing this library I wrote that the source language code of the current page is |
Beta Was this translation helpful? Give feedback.
Sorry bro, When writing this library I wrote that the source language code of the current page is
en
, I'm sorry. I will provide a prop calleddefaultPageLanguageCode
to accomplish your needs. In the v1.0.0 version, if your webpage source language is Chinese, you can passzh-CN
todefaultPageLanguageCode
.🙏