【问题标题】:i18next html escaped - server side generated emails needing  i18next html 转义 - 服务器端生成的电子邮件需要
【发布时间】:2014-11-09 13:28:28
【问题描述】:

我使用 i18next 翻译电子邮件模板。它们包含文本需要具有  的按钮,以防止智能手机电子邮件阅读器出现错误呈现。为了防止智能手机电子邮件阅读器将按钮分成两部分,我确实需要有不间断的空格。

问题是,i18next 转义了 html。

我的按钮中没有My button,而是My button

这是一个简化版本(伪代码),说明了我想要实现的目标:

BTN_ACTION = 'My button';

i18n.init(options, function (t) {
    t('BTN_ACTION')
};

玉模板长这样:

a#btn-create-account(href='url')=t('BTN_ACTION')

【问题讨论】:

  • 您是否尝试在源代码或其代码点中直接使用 Unicode 字符? My\u00A0button?
  • 这很好用,非常感谢!

标签: javascript email translation i18next


【解决方案1】:

在源代码或其代码点中直接使用 Unicode 字符,如 My\u00A0button

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-15
    • 2015-11-08
    • 1970-01-01
    • 1970-01-01
    • 2014-11-23
    相关资源
    最近更新 更多