The example produces a complete participant sentence and a queue-position label. Count 1 becomes “1 participant is waiting”; 0 and 2 use “participants are waiting.” Position 21 becomes 21st, while 11,12,13 all use th. The page calls the runtime's Intl.PluralRules for both categories and shows them separately. This is fictional queue copy, not a registration count or live arrival system.

Branch the whole message
Create a cardinal formatter with en-US and select the current integer count. Map category one to the full singular sentence and other to the full plural sentence. The API chooses a category; your message map supplies the words. It does not pluralize a noun or conjugate a verb automatically. Keeping the entire sentence in one branch makes changes to noun, verb and surrounding wording reviewable together rather than scattering singular exceptions across several string fragments.
Check zero, one and two before expanding the interface. “0 participants are waiting” needs the plural branch even though zero is a special operational state. A writer might later prefer “No participants are waiting,” but that would be an explicit copy choice, not a new grammatical category inferred by this code. The example keeps the numeric count visible so the developer can compare actual input and selected output without guessing whether a special empty-state message was applied.
Use ordinal rules for position
Create a second formatter with type ordinal. In the US-English suffix map, one maps to st, two to nd, few to rd, and other to th. The specimen strip includes 1st,2nd,3rd,4th,11th,12th,13th,21st,22nd,23rd, generated by that same formatter. The teen cases expose an incorrect helper that considers only the last digit. Position 12 has the same final digit as 2 but needs th, so testing only the first four positions misses the error.
Do not reuse ordinal categories for participant counts. A count of three and a third-place position answer different questions, even when both originate as integers. Keep input labels and inspection readouts separate. A reader needs a grammatically correct ticket; a developer may also need category other versus few to understand which message branch ran. Put that technical information below the primary sentence rather than making the person waiting in line interpret category names to understand their place.
Declare the bounded input contract
This exercise accepts integer counts 0 through 100 and integer positions 1 through 100. Blank, negative, fractional and out-of-range values receive a correction message. Do not coerce a blank input to zero or round 1.5 into a participant. The page checks each output independently, so an invalid count does not erase a valid position. Reset restores count 1 and position 21. If the API is unavailable, show that state rather than silently substituting an unchecked last-digit rule.
Keep locale rules and message wording together during review. The map is for US English; switching locale alone would not translate the sentences or provide another language's appropriate branches. When changing “participants waiting” to “people ahead,” review zero, singular and plural wording again and check 11th, 12th, and 13th again. Preserve the maintained message map as the source of the deployed interface; the workbench makes those editorial and runtime choices inspectable without pretending to manage an actual queue.
Make your own working example
Create a fictional en-US workshop queue copybench using native Intl.PluralRules. Count input default 1 accepts integers 0-100; position input default 21 accepts 1-100. Use separate cardinal and ordinal formatters. Cardinal one selects complete N participant is waiting. Other selects N participants are waiting. Show category in a secondary readout, not as the main result.
Ordinal maps one st,two nd,few rd,other th. Show Your place:N+suffix and generate specimen strip 1,2,3,4,11,12,13,21,22,23 with the same formatter. Verify teens use th. Provide count 0/count 1/count 2 preset buttons, Update ticket and Reset. Validate blank, negative, fractional and out-of-range values explicitly, never round or coerce empty to zero. Clear invalid derived output with an instruction, keeping the other valid field independent.
Style the result as a readable workshop entry ticket, with inputs and developer categories below or beside it. If Intl.PluralRules is unavailable, show an honest unavailable state instead of a guessed fallback. Use no real queue, registration, storage, translation service or network. Retain en-US as a fixed message contract.
Use one self-contained HTML file with no remote dependency. Keep the initial sample, output, and labeled controls near the top. Use at least 16px text, strong contrast, visible focus, and a stacked layout at 360px without horizontal overflow. Use explicit type=button click handlers and explicit DOM selectors; do not depend on native form submission. Clear stale feedback when task inputs change. Render entered text safely. Keep practice data local to the current page; do not imply saving, sending, or production integration. Return only the finished HTML.
Review the one-person ticket
Keep the maintained message map with the interface source. An HTML ticket comparison can be read in NOS; eligible static explanatory notes can be revised visually without asking AI to regenerate the HTML. Clarify the wording decision there, then update the actual singular and plural branches together.