You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of my sentences which I localized with i18n contains an anchor tag, and this element should trigger another modal. But, when I use @click or v-on:click localization gets broken.
Below is my resources.js file where I create i18n instance:
import { createI18n } from "vue-i18n";
import store from "../../store/index.js";
const activeLocale = store.getters.languageId;
const resources = createI18n({
locale: activeLocale,
fallbackLocale: "tr",
messages: {
en: {
expiredAccountPanel: {
info: "You have {accountCount} social media account(s) which needs to be reconnected. Please contact with your administrator. Click <a @click="openExpiredAccountsModal" style='color:#0D4BA0'>here</a> to view respective social media account(s)."
}
}
}
});
export default resources;
I imported this on my main.js as per below:
import resources from "./configs/localization/resources";
const app = createApp(App);
app.use(resources);
app.mount("#app");
I inject the texts to be localized to my custom warning-panel-base component like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
One of my sentences which I localized with i18n contains an anchor tag, and this element should trigger another modal. But, when I use
@click
orv-on:click
localization gets broken.Below is my resources.js file where I create i18n instance:
I imported this on my main.js as per below:
I inject the texts to be localized to my custom warning-panel-base component like this:
Finally, this is my respective custom component:
Instead of
<span>{{ text }}</span>
I also tried<span v-html="text"></span>
but it didn't work out too.How should I properly implement a vue specific directive inside i18n text?
Beta Was this translation helpful? Give feedback.
All reactions