mirror of
https://github.com/unraid/api.git
synced 2026-01-05 16:09:49 -06:00
fix(web): escaping html-encoded symbols like apostrophes in translations (#1002)
e.g. end user would see `'` from translations
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import en_US from '~/locales/en_US.json';
|
||||
import { provide } from 'vue';
|
||||
import { createI18n, I18nInjectionKey } from 'vue-i18n';
|
||||
import { createHtmlEntityDecoder } from '~/helpers/i18n-utils';
|
||||
|
||||
import en_US from '~/locales/en_US.json';
|
||||
// import ja from '~/locales/ja.json';
|
||||
|
||||
const defaultLocale = 'en_US'; // ja, en_US
|
||||
@@ -34,7 +35,9 @@ const i18n = createI18n<false>({
|
||||
en_US,
|
||||
// ja,
|
||||
...(nonDefaultLocale ? parsedMessages : {}),
|
||||
}
|
||||
},
|
||||
/** safely decodes html-encoded symbols like & and ' */
|
||||
postTranslation: createHtmlEntityDecoder(),
|
||||
});
|
||||
|
||||
provide(I18nInjectionKey, i18n);
|
||||
|
||||
Reference in New Issue
Block a user