Skip to content

Mention string templates should not be used as they cannot be localised #147

@aral

Description

@aral

Discussed in #146

Originally posted by aral November 5, 2021
Reference: https://github.com/elementary/docs/blob/master/writing-apps/code-style.md#string-formatting

It would be good to provide a reason for why string templates are discouraged, given their ergonomic advantages over remembering every % code on the planet.

I haven’t been able to find any information on how translations work/don’t work with string templates but I’m assuming they are complicated at the very least. Is this the reason why they’re discouraged?

I’ve now confirmed that string templates are not picked up/included in .po files.

We should mention this reason in the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions