【国际化】文段中的HTML标签(JQuery-i18next)

javascript - HTML tags in i18next translation - Stack Overflow

问题:

【国际化】文段中的HTML标签(JQuery-i18next)_第1张图片

解决方法:

<div class="i18n" data-i18n="[html]content.body">

【国际化】文段中的HTML标签(JQuery-i18next)_第2张图片
源码:

if (attr === 'html') {
      ele.html(i18next.t(key, extendDefault(opts, ele.html())));
    }

src/index.js · xlieee/jquery-i18next - 码云 - 开源中国 (gitee.com)

文档:

jquery-i18next: i18next plugin for jquery usage (gitee.com)

你可能感兴趣的:(前端小问题,html,jquery,前端)