Công cụ miễn phí

    Trình định dạng & Trình chỉnh sửa tin nhắn ICU

    Xây dựng, kiểm tra và xác thực chuỗi ICU MessageFormat với xem trước trực tiếp, hơn 100 mẫu và xác thực số nhiều CLDR đa ngôn ngữ.

    Mẫu50
    ICU Trình chỉnh sửa
    Cú pháp hợp lệ
    14 ký tự1 dòng

    Biến kiểm tra & Xem trước trực tiếp

    Điều chỉnh các biến và chuyển đổi ngôn ngữ để xác minh quy tắc CLDR

    Ngôn ngữ:
    Kết quả hiển thị (en):
    Hello, Alex!
    Xuất sang khai báo an toàn kiểu của Intlayer
    import { type Dictionary } from 'intlayer';const convertedMessageContent = {  key: 'converted-message',  content: 'Hello, {{name}}!',} satisfies Dictionary;export default convertedMessageContent;
    Intlayer xác thực bản dịch tại thời điểm biên dịch với tính năng tự động hoàn thành TypeScript đầy đủ.

    ICU MessageFormat Syntax Cheat Sheet

    Quy tắc cú pháp nhanh và cách mỗi mẫu ánh xạ tới khai báo Intlayer

    Tính năngCú phápVí dụGhi chúTương đương trong Intlayer
    Simple Variable{variableName}Hello {name}!Alphanumeric names, single brackets{{name}}
    Pluralization{count, plural, one {...} other {...}}{n, plural, one {# item} other {# items}}Requires "other". # is replaced by count.plural({ one: "1 item", other: "{{count}} items" })
    Exact Match Plural=0 {...} =1 {...}{n, plural, =0 {None} one {#} other {#}}Takes precedence over CLDR keywordsenu({ 0: "None", 1: "1", fallback: "{{count}}" })
    Select (Context/Gender){key, select, choice1 {...} other {...}}{gender, select, male {He} other {They}}Case-sensitive exact string comparisonselect({ male: "He", fallback: "They" }, "gender")
    Selectordinal{rank, selectordinal, one {#st} other {#th}}{pos, selectordinal, one {#st} two {#nd} other {#th}}Ordinal suffix rules per CLDRenu({ 1: "1st", 2: "2nd", fallback: "{{pos}}th" })
    Number Formatting{val, number, [style]}{price, number, currency}Supports percent, currency, integer stylesIntl.NumberFormat or type-safe formatting
    Escaping'{' and '' for apostrophesDon''t '{'escape'}'Single quotes escape literal blocks, '' escapes quoteLiteral strings naturally supported
    Kiến trúc dựa trên trình biên dịch của Intlayer thay thế việc phân tích cú pháp trong thời gian chạy bằng tính an toàn kiểu tại thời điểm biên dịch.
    Hệ sinh thái Intlayer

    Không còn phải lo lắng về cú pháp phức tạp nữa

    Intlayer biến quốc tế hóa thành trải nghiệm phát triển thú vị với tính an toàn kiểu tại thời điểm biên dịch, tự động trích xuất thành phần và tích hợp CMS liền mạch.