免费工具

    Vue I18n 消息格式化与编辑器

    使用管道复数(0 | 1 | 其他)、命名格式化 {name} 和链接消息 @:key 构建和测试 Vue I18n 翻译消息。

    模板10
    VUE-I18N 编辑器
    语法有效
    34 字符1

    测试变量与实时预览

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

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

    Vue I18n Syntax Cheat Sheet

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

    功能语法示例备注Intlayer 等效写法
    Named Formatting{variableName}Hello {name}!Single braces for named parameters{{name}}
    List Formatting{0}, {1}, ...Hello {0} and {1}Index-based positional arguments{{0}} or named variables
    Pipe Pluralizationno items | 1 item | {n} itemsno apples | 1 apple | {n} applesPipes separate 0, 1, and plural formsplural({ 0: "no apples", 1: "1 apple", other: "{{count}} apples" })
    Linked Messages@:path.to.messageHome of @:brand.nameReferences other messages in the dictionaryTypeScript object references
    Literal Interpolation{'literal'}{'hello'} {name}Single-quoted literal inside bracesLiteral strings
    Intlayer 基于编译器的架构用编译时类型安全和自动化提取取代了复杂的运行时消息解析。
    Intlayer 生态系统

    无需再为复杂的语法烦恼

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