Skip to content

Text replacement should use enum values instead of magic integers #490

@tonihele

Description

@tonihele

Text replacement should use enum values instead of magic integers. TextUtils parse the indices (the magic integers) from the strings and pass these to the text replacer. It would be incredibly helpful and easy to use enum values instead. The magic numbers seem to mean the same thing in all of the strings. And the way we currently do this is scattered to different handlers that know the context. Meaning of the magic integers are duplicated in all of those.

Some values we already have mapped in the code, and some would be helpful to extract from the translation files. These are usually simple enough to be deducted from the context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    easyShould be easy for new comers etc.enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions