Skip to content

Convert all fixed strings to use FormattedMessage (or similar) #527

@paulkaplan

Description

@paulkaplan

All hard-coded strings (i.e. "blocks", "costumes", "sounds" in the tabs) should use FormattedMessage or similar from the react-intl package.

A few things that are important:

  • You have to use either FormattedMessage or defineMessages in for the babel plugin to automatically pick them up.
  • You must include all three properties to those methods: (1) english text, (2) a globally unique id in the style of the other ids, (3) a "description" which can act as a translator hint about what the contextual meaning of the string is.
  • The naming convention should be gui.<component|container>. - this means existing messages need to be updated as we didn't have a naming convention when we started.

To aid in finding those places, you can add rules: {'react/jsx-no-literals': [2]}, to the eslintrc, which will error linting on all literals in jsx.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions