Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.
This repository was archived by the owner on Jul 11, 2026. It is now read-only.

i18n format placeholders order #24

Description

@deluxghost

A language may have different word order from English. Consider an example sentence:

Sentence {foo} {bar}.

that will be formatted to:

Sentence <b>foo</b> <i>bar</i>.

While translating to another language, the translator might need to change the order of placeholders:

{Bar} {foo} seeeenteeeeenceeee.

This will still be formatted in the original order like this:

<b>Bar</b> <i>foo</i> seeeenteeeeenceeee.

Many i18n frameworks have placeholders with number:

Sentence {1} {2}.

these placeholders can be moved to break the order and still work.

While I really like your placeholder concept, I suggest adding a feature like this, add an order number as a prefix:

Sentence {1:foo} {2:bar}.

therefore we can translate it like this:

{2:Bar} {1:foo} seeeenteeeeenceeee.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions