Skip to content

Make preview modal tooltips translatable by translators #3252

@chrisgarrity

Description

@chrisgarrity

Unfortunately the babel tool that automatically extracts localization messages only recognizes defineMessages(...) and <FormattedMessage ... />

Uses of intl.formatMessage(...) won't throw an error, but the string definition will not get extracted by the tool and therefore will not be available to be translated. For example:
https://github.com/LLK/scratch-gui/blob/2753c00a14e998fe30e2b0f2caa2568f64c8fc96/src/components/preview-modal/preview-modal.jsx#L55-L59

Instead we should move the message definition into a defineMessages call, and then call intl.formatMessage with the data from the messages object.

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