Skip to content

[Translation] Allow to test apps with pseudo localization #35666

@javiereguiluz

Description

@javiereguiluz

Description
When developing i18n apps, Symfony reports any missing translation. This is great, but it's not enough to spot some errors. For example, some contents may be translated ... but not properly escaped, leading to issues. Or they could be translated but then truncated for being too long, etc.

This problem is solved with pseudo localization. Instead of translating the contents, they are altered to use other characters (although visually similar to make them readable) and they are added some extra characters to make them a bit longer and to spot wrong truncations. For example:

Original text:     Account Settings
"Translated" text: [!!! Àççôûñţ Šéţţîñĝš !!!]

Lots of companies use this localization testing technique. Read for example this blog post from Slack:

image

Example
How could this work in Symfony apps? We could enable a special pseudo locale that makes this transformation:

# config/packages/translation.yaml
framework:
    default_locale: pseudo
    # ...

Or we could create a new option to enable it:

# config/packages/translation.yaml
framework:
    pseudo_localization: true
    # ...

Things to consider
If this is accepted, we could only implement it for languages using the Latin script (which is 70% of world population).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions