מעצב ועורך הודעות של Intlayer
בנו, בדקו ואמתו הצהרות תוכן בטוחות בטיפוסים של Intlayer עם החלפות {{var}}, t(), plural(), enu(), select(), cond() ו-markdown.
תבניות18
INTLAYER עורך
תחביר תקין
36 תווים1 שורות
משתני בדיקה ותצוגה מקדימה חיה
שנו משתנים והחליפו שפות כדי לאמת את כללי הרבים של CLDR
שפה:
פלט מרונדר (en):
Hello Alex, welcome to Intlayer!
ייצוא להצהרה בטוחה בטיפוסים של Intlayer
Intlayer מאמתת תרגומים בזמן הקומפילציה עם השלמה אוטומטית מלאה של TypeScript.
Intlayer Message Format Syntax Cheat Sheet
כללי תחביר מהירים וכיצד כל דפוס ממופה להצהרות בטוחות בטיפוסים של Intlayer
| פיצ'ר | תחביר | דוגמה | הערות | המקבילה ב-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) |
הארכיטקטורה מבוססת הקומפיילר של Intlayer מחליפה ניתוח הודעות מורכב בזמן ריצה בבטיחות טיפוסים בזמן קומפילציה ובחילוץ אוטומטי.
האקוסיסטם של Intlayer
לעולם אל תדאגו שוב מתחביר מורכב
Intlayer הופכת את הבינאום לחוויית פיתוח מהנה עם בטיחות טיפוסים בזמן קומפילציה, חילוץ אוטומטי מקומפוננטות ושילוב חלק עם ה-CMS.