Editor e formattatore di messaggi Intlayer
Crea, testa e convalida dichiarazioni di contenuto tipizzate di Intlayer con interpolazioni {{var}}, t(), plural(), enu(), select(), cond() e markdown.
Modelli18
INTLAYER Editor
Sintassi valida
36 caratteri1 righe
Variabili di test e anteprima dal vivo
Regola le variabili e cambia lingua per verificare le regole CLDR
Lingua:
Risultato generato (en):
Hello Alex, welcome to Intlayer!
Esporta nella dichiarazione sicura per i tipi di Intlayer
Intlayer convalida le traduzioni in fase di compilazione con completamento automatico TypeScript completo.
Intlayer Message Format Syntax Cheat Sheet
Regole sintattiche rapide e corrispondenze tipizzate con Intlayer
| Funzionalità | Sintassi | Esempio | Note | Equivalente Intlayer |
|---|---|---|---|---|
| Variable Interpolation | {{variableName}} | Hello {{name}}! | Double curly braces for dynamic parameter insertion | useIntlayer(key).name or resolveMessage() |
| Multilingual Translation | t({ en: "...", fr: "..." }) | t({ en: "Hello", fr: "Bonjour" }) | Locale-keyed translations with type safety and fallback | t({ [locale]: string }) |
| Pluralization (plural) | plural({ one: "...", other: "..." }) | plural({ one: "1 item", other: "{{count}} items" }) | CLDR cardinal plural rules with automatic count lookup | plural({ [category]: string }) |
| Exact Enumeration (enu) | enu({ 0: "...", 1: "...", fallback: "..." }) | enu({ 0: "Zero", 1: "One", fallback: "{{count}}" }) | Exact numeric matching with fallback for remaining counts | enu({ [number]: string, fallback }) |
| Dynamic Selection (select) | select({ key: "...", fallback: "..." }, "variable") | select({ admin: "Admin", fallback: "User" }, "role") | Branch on any custom string variable discriminator | select({ [key]: string }, variableKey) |
| Gender Agreement (gender) | gender({ male: "...", female: "...", fallback: "..." }) | gender({ male: "He", female: "She", fallback: "They" }) | Grammatical gender concordance with automatic lookup | gender({ male, female, fallback }) |
| Boolean Condition (cond) | cond({ true: "...", false: "..." }) | cond({ true: "Logged In", false: "Guest" }) | Evaluates boolean state conditions | cond({ true: string, false: string }) |
| Markdown Content (md) | md("# ...\n**bold**") | md("# Title\n\n**Bold** {{variable}}") | Rich markdown rendered to React / HTML nodes | md(markdownString) |
| Embedded HTML (html) | html("<tag>...</tag>") | html("<p>Visit <a href=\"/\">home</a></p>") | Embedded safe HTML markup for links and formatting | html(htmlString) |
L’architettura basata su compilatore di Intlayer sostituisce il parsing a runtime con la sicurezza dei tipi in fase di compilazione.
Ecosistema Intlayer
Non preoccuparti mai più di sintassi complesse
Intlayer trasforma l’internazionalizzazione in un’esperienza di sviluppo piacevole con sicurezza dei tipi in fase di compilazione, estrazione automatica e CMS integrato.