I\'m using i18next to power i18n for my weblog. It works great on text-only content, but when I try to translate content that includes HTML markup, it is displaying the raw
From the documentation:
Hint 3: Escaping:
// given resources { 'en-US': { translation: { key1: Not escaped __nameHTML__, key2: Escaped __name__ } } }; i18n.t("key2", { name: '', escapeInterpolation: true }); // -> Escaped <tag> i18n.t("key1", { name: '', escapeInterpolation: false }); // -> Not escaped
Adding suffix 'HTML__' to your value will prevent the escaping even if option is set so.
You could turn on escaping on init
i18n.init({escapeInterpolation: true});
or by passing in option to t function like in the sample.