S1.06.4Reorderable named placeholdersdesign

Placeholder order must be rearrangeable

Aliases: named arguments · argument reordering · positional placeholder

What it is

Reorderable named placeholders let translators move dynamic arguments into target-language order while runtime continues to supply each value by stable identity. The facility solves argument addressing: {actor}, {object}, and {time} can change order, or be referenced again where the format permits, without treating a value as merely “the first string.”

Why it happens

Unnumbered %s binds identity to occurrence order and cannot be moved safely. Explicitly indexed {0} or %2$s can be reordered, but remain semantically opaque and easy to swap when values share a type. Names decouple order from identity. A caller input contract declares required or optional values and types; a translation occurrence policy separately allows each locale/variant to reference an argument zero, one, or multiple times and can require a minimum occurrence for critical values.

Where it stops holding

A named placeholder moves a complete semantic value; it does not automatically change internal name order, date formatting, case, or articles. If an argument contains a source-language adposition or suffix, moving it cannot create a natural target sentence. A language may legitimately omit a supplied value through pro-drop or repeat it for clarity without a runtime branch, provided the locale pattern satisfies that argument's occurrence policy.

Applying it

  • Prefer semantic names over unnumbered %s; separately declare whether callers must supply each value and whether locale patterns may reference it 0/1/multiple times.
  • Pass raw dates and quantities to supported locale formatters. Format structured names only when platform and field model support it; otherwise preserve the complete name. Keep relational words and punctuation outside values.
  • Reject undeclared names, missing required caller inputs, and type mismatches; validate each locale/variant against occurrence policy instead of forcing its argument set to equal the source.
  • Test reordering with two or more distinguishable values of the same type, verifying each actor, object, and time plus agreement between visual and screen-reader order.

Related

  • Same group: S1.06.1 Word order differs across languages · S1.06.2 Concatenated fragments cannot be translated correctly · S1.06.3 Use complete sentence templates with placeholders
  • Adjacent: S1.04 Plural, gender, and grammatical variation · S1.05 Translation context and string reuse
  • Search terms: named placeholders · argument reordering · message format validation

Cards in the same group

Quick Actions

Share

Share this page

ios_share

https://hci.top/en/handbook/S1.06.4