Skip to content

Pushing towards named placeholder in messages #2457

@timofei-iatsenko

Description

@timofei-iatsenko

Lingui supports deriving name of the placeholder from the variable name. It might sounds like a cool idea at the first glance, but that has few unexpected consequences.

Developers used to the fact that variable name doesn't affect how code is working. So renaming a variable should not break anything.

When a placeholder name is inherited from a variable name - it's breaking this rule, and developer could accidentaly rename variable and it would break the translation unexpectedly.

Also this inheritance will not work in the full-runtime macro which i'm having plans of implementing.

So i want to push thru the documentation and eslint rule to use a named placeholders evereywhere, and deprecate the old way.

ToDo List:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions