【问题标题】:Add custom translation inside placeholder attribute with i18next使用 i18next 在占位符属性中添加自定义翻译
【发布时间】:2018-04-15 14:19:17
【问题描述】:

是否可以在占位符内添加/附加一些硬编码文本? 例如,我们有一些像“示例:”这样的文本,我们希望它出现在占位符中的翻译文本之前。

没有前置/附加静态文本的原始 html:

<input type="text" data-i18n="[placeholder]translationKEY"/>

相关问题:Translate custom attributes with i18next (placeholder, value)

【问题讨论】:

    标签: javascript jquery localization translation i18next


    【解决方案1】:

    我看到的唯一选项是自定义代码或使用嵌套功能https://www.i18next.com/nesting.html 并将“示例:”嵌套到“translationKEY”值的值中

    【讨论】:

    • 忘了提到理想情况下我不应该更改任何命名空间翻译等。我猜自定义代码意味着例如使用 js/jQuery 来查找所有这些占位符并在属性上添加前缀?
    猜你喜欢
    • 2014-05-08
    • 2015-12-26
    • 2017-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-17
    相关资源
    最近更新 更多