Vue i18n translation inside grid template is undefined

Hello,

I am using the i18n Vue plugin for localization. Everything works fine until I try to use the i18n $t() method inside a custom template for a column of the Grid. I get error vue.esm.js:1897 TypeError: Cannot read property '_t' of undefined at Proxy.Vue.$t. Isnt the Vue component that I pass to the template property supposed to have the same Vue instance and therefore I could use all plugins that I have previously defined to use in main.js file?

dropdownTemplate: function() {
return {
template: Vue.component("bindDropdown", {
template: `<div>{{$t('textExample')}}</div>`,
data: function() {
return {
};
}
})
};
}

Here is a code example, you can check App.vue - https://codesandbox.io/s/vue-template-1pq8y

3 Replies 1 reply marked as answer

RS Rajapandiyan Settu Syncfusion Team June 25, 2020 11:17 AM UTC

Hi Alex, 

Greetings from syncfusion support. 
 
Query : Isnt the Vue component that I pass to the template property supposed to have the same Vue instance and therefore I could use all plugins that I have previously defined to use in main.js file? 
 
Currently, we are not able to access the root element inside template in Vue platform because Syncfusion Vue is rendered natively using wrapper approach. We have checked the reported issue and considered this as feature request with this title “Vue root instance needs to be accessed inside template”. We expect that it will be available in any of our upcoming release since we are not able achieve this with our current architecture. We will analyze further and fix this with feasible solution in any of our upcoming release.   

You can track the status of the feature from the below feedback portal link.  


Please cast your vote to make it count. We will prioritize the features every release based on the demands.  

If you have any more specification/suggestions to the feature request you can add it as a comment in the portal.  

Please get back to us if you need any further assistance on this.  

Regards, 
Rajapandiyan S 


Marked as answer

AL Alex replied to Rajapandiyan Settu June 25, 2020 02:54 PM UTC

Hi Alex, 

Greetings from syncfusion support. 
 
Query : Isnt the Vue component that I pass to the template property supposed to have the same Vue instance and therefore I could use all plugins that I have previously defined to use in main.js file? 
 
Currently, we are not able to access the root element inside template in Vue platform because Syncfusion Vue is rendered natively using wrapper approach. We have checked the reported issue and considered this as feature request with this title “Vue root instance needs to be accessed inside template”. We expect that it will be available in any of our upcoming release since we are not able achieve this with our current architecture. We will analyze further and fix this with feasible solution in any of our upcoming release.   

You can track the status of the feature from the below feedback portal link.  


Please cast your vote to make it count. We will prioritize the features every release based on the demands.  

If you have any more specification/suggestions to the feature request you can add it as a comment in the portal.  

Please get back to us if you need any further assistance on this.  

Regards, 
Rajapandiyan S 


Hello Rajapandiyan, thanks for the reply. 
It seems that I cannot access the link, I dont have an access

Here is the error message:




RS Rajapandiyan Settu Syncfusion Team June 26, 2020 07:23 AM UTC

Hi Alex, 

Sorry for the inconvenience caused. 
  
Now, you can access the feedback link. Please check and let u know if you still face the problem. 

Regards, 
Rajapandiyan S 


Loader.
Up arrow icon