Preview MF1 and locate copied invisible syntax
Keep the original ICU pattern and parameter JSON, preview a finite locale profile and use source positions to repair copied syntax deliberately.
Prepare the two original inputs
Paste a pattern or select at most one strict UTF-8 message file, up to 1 MiB. The file replaces only the primary pattern; keep the secondary parameter JSON paste, also up to 1 MiB. Original filename labels allow 512 UTF-8 bytes.
Remove at most one leading UTF-8 BOM per input as transport only, record it and preserve both original byte sequences. Reject malformed UTF-8 and raw or JSON-escaped unpaired Unicode surrogates. Decoded duplicate parameter keys refuse the whole run.
- Paste a message or select one original UTF-8 pattern file, then paste the named parameter JSON.
- Choose the explicit locale and preview all branches with correctly typed parameters.
- For syntax errors inspect the mature code and visible codepoint positions, correct the source deliberately and retry.
- Copy or download the entire text, both unchanged originals and the parameter report before handoff.
Read the rendered result and the diagnosis
Choose en-US, en-GB, zh-CN, fr-FR, ru-RU or ar-EG. Default en-US. Support literal text, optional apostrophe quoting, bare arguments, select, cardinal plural, selectordinal, offset, =selectors, # and unstyled number. Every select/plural needs other.
Parameters are scalar Unicode strings or exact mathematical safe integers from −9,007,199,254,740,991 to 9,007,199,254,740,991, checked before JavaScript Number conversion. Decimal/scientific tokens are allowed only when their value is an exact integer. Counts, offsets and =selectors must be nonnegative. Explicit =selectors use canonical decimal spelling: =0 or =[1-9][0-9]*, without a plus sign, leading zeros or −0.
Refuse fractional values, date/time, styles, skeletons, currency, rich tags/angle brackets, MF2 declarations, callbacks and resolvers. Validate required parameters and types in every AST branch, including unselected branches. Report valid unused scalar parameters.
{gender, select, female {{n, plural, offset:1 =1 {Alex arrived alone.} one {Alex and one guest arrived.} other {Alex and # guests arrived.}}} other {{n, plural, offset:1 =1 {Alex arrived alone.} one {Alex and one guest arrived.} other {Alex and # guests arrived.}}}}
{"gender":"female","n":3}
=> Alex and 2 guests arrived.Save a complete handoff
Allow 20,000 AST nodes, 65 unquoted syntactic brace levels, 1,000 parameter names, 128 UTF-8 bytes per name and 65,536 UTF-8 bytes per string value. Quoted literal braces do not consume syntactic depth.
Complete rendered text allows 8 MiB of UTF-8. Preview only 4,000 Unicode codepoints; native copy and rendered-message.txt preserve the whole result. Download both originals and the complete parameter metadata report; hidden-character locations in the report are explicitly a first-200 preview.
Bare numeric arguments use FormatJS String(value), while number and # use this browser’s Intl locale data. Output may change with runtime locale data; this is not universal ICU4J compatibility. Syntax errors show mature codes, original UTF16 offset/line/column, UTF8 byte offset and nearby U+00A0 positions. Never repair NBSP automatically.
Correct missing parameters, types, duplicate keys or unsupported syntax, then rerun. After cancellation keep the same selected file, parameter JSON and locale and retry. An internal parser failure is not a syntax diagnosis.
| File | Purpose |
|---|---|
| rendered-message.txt | Full selected plain text, up to 8 MiB |
| message-original.icu | Exact effective original pattern, including any transport BOM |
| parameters-original.json | Exact original parameter JSON |
| message-preview-report.json | Every parameter name/type/use; sources, runtime and explicit ancillary location preview |
References
- Copied invisible whitespace in ICU syntax
The author withdrew the original parser-bug claim after locating NBSP in syntax, then requested a visible warning. The three patterns and all six comments were reviewed; browser preference and demand scale remain unknown.
- FormatJS interpreted MessageFormat AST
This tool uses the finite plain-text MF1 profile and runtime Intl. It does not promise full ICU4J compatibility, rich tags or MF2.
- ICU MessageFormat1 syntax
Select/plural other, offsets, pound substitution and optional apostrophe quoting; styles and date/time stay outside this profile.
Tools in this category
Expand a tool to see its steps, options and supported formats, then open its workspace.
Preview ICU MessageFormat1Render nested ICU select and plural messages locally, and locate invisible syntax characters with original source positions.
Render nested ICU select and plural messages locally, and locate invisible syntax characters with original source positions.
Steps
- Paste a message or select one original UTF-8 pattern file, then paste the named parameter JSON.
- Choose the explicit locale and preview all branches with correctly typed parameters.
- For syntax errors inspect the mature code and visible codepoint positions, correct the source deliberately and retry.
- Copy or download the entire text, both unchanged originals and the parameter report before handoff.
Available options
- Locale
- en-US · en-GB · zh-CN · fr-FR · ru-RU · ar-EG
Explicit locale data in this browser; defaults to en-US.
Capabilities and limits
- Paste a pattern or select at most one strict UTF-8 message file, up to 1 MiB. The file replaces only the primary pattern; keep the secondary parameter JSON paste, also up to 1 MiB. Original filename labels allow 512 UTF-8 bytes.
- Remove at most one leading UTF-8 BOM per input as transport only, record it and preserve both original byte sequences. Reject malformed UTF-8 and raw or JSON-escaped unpaired Unicode surrogates. Decoded duplicate parameter keys refuse the whole run.
- Choose en-US, en-GB, zh-CN, fr-FR, ru-RU or ar-EG. Default en-US. Support literal text, optional apostrophe quoting, bare arguments, select, cardinal plural, selectordinal, offset, =selectors, # and unstyled number. Every select/plural needs other.
- Parameters are scalar Unicode strings or exact mathematical safe integers from −9,007,199,254,740,991 to 9,007,199,254,740,991, checked before JavaScript Number conversion. Decimal/scientific tokens are allowed only when their value is an exact integer. Counts, offsets and =selectors must be nonnegative. Explicit =selectors use canonical decimal spelling: =0 or =[1-9][0-9]*, without a plus sign, leading zeros or −0.
- Refuse fractional values, date/time, styles, skeletons, currency, rich tags/angle brackets, MF2 declarations, callbacks and resolvers. Validate required parameters and types in every AST branch, including unselected branches. Report valid unused scalar parameters.
- Allow 20,000 AST nodes, 65 unquoted syntactic brace levels, 1,000 parameter names, 128 UTF-8 bytes per name and 65,536 UTF-8 bytes per string value. Quoted literal braces do not consume syntactic depth.
- Complete rendered text allows 8 MiB of UTF-8. Preview only 4,000 Unicode codepoints; native copy and rendered-message.txt preserve the whole result. Download both originals and the complete parameter metadata report; hidden-character locations in the report are explicitly a first-200 preview.
- Bare numeric arguments use FormatJS String(value), while number and # use this browser’s Intl locale data. Output may change with runtime locale data; this is not universal ICU4J compatibility. Syntax errors show mature codes, original UTF16 offset/line/column, UTF8 byte offset and nearby U+00A0 positions. Never repair NBSP automatically.