fix(web): escaping html-encoded symbols like apostrophes in translations (#1002)

e.g. end user would see `'` from translations
This commit is contained in:
Pujit Mehrotra
2025-01-06 14:59:36 -05:00
committed by GitHub
parent 91de6e6c1e
commit 4ee42a6cf6
3 changed files with 34 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
import { createI18n } from 'vue-i18n';
import en_US from '@/locales/en_US.json';
import en_US from '@/locales/en_US.json';
import { createHtmlEntityDecoder } from '~/helpers/i18n-utils';
export default defineNuxtPlugin(({ vueApp }) => {
const i18n = createI18n({
@@ -11,6 +12,7 @@ export default defineNuxtPlugin(({ vueApp }) => {
messages: {
en_US,
},
postTranslation: createHtmlEntityDecoder(),
});
vueApp.use(i18n);