dkfbasel / vuex-i18n

Localization plugin for vue.js 2.0 using vuex as store
MIT License
666 stars 56 forks source link

How to translate a component attribute/property #128

Open drtobbyas opened 3 years ago

drtobbyas commented 3 years ago

How do I translate a component passed-in attribute/property. I have checked the doc and online for an example usage but can't find any. Please pardon If I may be posting this question in the wrong place.

My scenario

For instance, I have a card component that is define like this ` // card component --- card.vue

` which is being used in another component like this

` // home page -- home.vue

`

The question is how do I translate title and description prop

I know I could add the translation with {{ $t("card.title")}} in the card component where the props were used but the card component we are talking about is a third-party library component which I can't fiddle with the implementation directly.

Please can you profer a solution to this as I couldn't find any usage of such in the docs. I think usage like this is very common.

Thanks