מעצב ועורך הודעות ICU
בנו, בדקו ואמתו מחרוזות ICU MessageFormat עם תצוגה מקדימה חיה, יותר מ-100 תבניות ואימות רבים לפי CLDR במספר שפות.
תבניות50
ICU עורך
תחביר תקין
14 תווים1 שורות
משתני בדיקה ותצוגה מקדימה חיה
שנו משתנים והחליפו שפות כדי לאמת את כללי הרבים של CLDR
שפה:
פלט מרונדר (en):
Hello, Alex!
ייצוא להצהרה בטוחה בטיפוסים של Intlayer
Intlayer מאמתת תרגומים בזמן הקומפילציה עם השלמה אוטומטית מלאה של TypeScript.
ICU MessageFormat Syntax Cheat Sheet
כללי תחביר מהירים וכיצד כל דפוס ממופה להצהרות בטוחות בטיפוסים של Intlayer
| פיצ'ר | תחביר | דוגמה | הערות | המקבילה ב-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 keywords | enu({ 0: "None", 1: "1", fallback: "{{count}}" }) |
| Select (Context/Gender) | {key, select, choice1 {...} other {...}} | {gender, select, male {He} other {They}} | Case-sensitive exact string comparison | select({ male: "He", fallback: "They" }, "gender") |
| Selectordinal | {rank, selectordinal, one {#st} other {#th}} | {pos, selectordinal, one {#st} two {#nd} other {#th}} | Ordinal suffix rules per CLDR | enu({ 1: "1st", 2: "2nd", fallback: "{{pos}}th" }) |
| Number Formatting | {val, number, [style]} | {price, number, currency} | Supports percent, currency, integer styles | Intl.NumberFormat or type-safe formatting |
| Escaping | '{' and '' for apostrophes | Don''t '{'escape'}' | Single quotes escape literal blocks, '' escapes quote | Literal strings naturally supported |
הארכיטקטורה מבוססת הקומפיילר של Intlayer מחליפה ניתוח הודעות מורכב בזמן ריצה בבטיחות טיפוסים בזמן קומפילציה ובחילוץ אוטומטי.
האקוסיסטם של Intlayer
לעולם אל תדאגו שוב מתחביר מורכב
Intlayer הופכת את הבינאום לחוויית פיתוח מהנה עם בטיחות טיפוסים בזמן קומפילציה, חילוץ אוטומטי מקומפוננטות ושילוב חלק עם ה-CMS.