免费工具

    i18next 消息格式化与编辑器

    使用双括号插值、复数后缀(_one, _other)、上下文键和嵌套来格式化和测试 i18next 字符串。

    模板14
    I18NEXT 编辑器
    语法有效
    40 字符1

    测试变量与实时预览

    调整变量并切换语言以验证 CLDR 复数规则

    语言环境:
    渲染输出 (en):
    Hello Sarah, welcome to our platform!
    导出为 Intlayer 类型安全声明
    import { type Dictionary } from 'intlayer';const convertedMessageContent = {  key: 'converted-message',  content: 'Hello {{name}}, welcome to our platform!',} satisfies Dictionary;export default convertedMessageContent;
    Intlayer 在编译时通过完整的 TypeScript 自动补全来验证翻译。

    i18next Syntax Cheat Sheet

    快速语法规则以及每个模式如何映射到 Intlayer 的类型安全声明

    功能语法示例备注Intlayer 等效写法
    Interpolation{{variableName}}Hello {{user.name}}!Double curly braces, supports dot paths{{user.name}}
    Unescaped HTML{{- rawVar}}Visit {{- url}}Disables HTML escaping for raw markuphtml(...) or Markdown
    Plural Keyskey_one, key_other"item_one": "1 item", "item_other": "{{count}} items"Suffix keys based on count parameterplural({ one: "1 item", other: "{{count}} items" })
    Context Suffixkey_context"friend_female": "Girlfriend"Key appended with context parameterselect({ female: "Girlfriend", fallback: "Friend" })
    Nesting$t(nested.key)Welcome, $t(common.brand)Reuses other translation keysDirect object property reuse in TS
    Formatting{{val, format}}{{date, YYYY-MM-DD}}Passes value through custom formattersStandard JavaScript/TypeScript helper
    Intlayer 基于编译器的架构用编译时类型安全和自动化提取取代了复杂的运行时消息解析。
    Intlayer 生态系统

    无需再为复杂的语法烦恼

    Intlayer 通过编译时类型安全、自动组件提取和无缝 CMS 集成,让国际化成为愉悦的开发体验。