Scratch-gui: Delete confirmation pop up is not translatable

Created on 23 Jul 2018  路  4Comments  路  Source: LLK/scratch-gui

Expected Behavior

_Please describe what should happen_
When you delete a sprite the pop-up asking for confirmation should be translated into the scratchers language.

Actual Behavior

_Describe what actually happens_
The alert is always in English - it's not wrapped in a localization call.
https://github.com/LLK/scratch-gui/blob/89dc5c0781100091650966babf5364ff07c63e9b/src/containers/sprite-selector-item.jsx#L80

bug help wanted localization

Most helpful comment

If anyone wants to implement this, it requires a few things. You can use a component like the playback-step.jsx for reference

  1. Import the formatMessage, injectIntl, intlShape, defineMessages from react-intl example
  2. define the message using defineMessage example
  3. Use this.props.formatMessage inside the alert to translate the message example
  4. Declare the intl shape in the proptypes example
  5. Wrap the component in injectIntl before exporting example

All 4 comments

If anyone wants to implement this, it requires a few things. You can use a component like the playback-step.jsx for reference

  1. Import the formatMessage, injectIntl, intlShape, defineMessages from react-intl example
  2. define the message using defineMessage example
  3. Use this.props.formatMessage inside the alert to translate the message example
  4. Declare the intl shape in the proptypes example
  5. Wrap the component in injectIntl before exporting example

Working on it, but export default is only allowed once...

You can change the bottom of the file to something like


export default connect(
    mapStateToProps,
    mapDispatchToProps
)(injectIntl(SpriteSelectorItem));

@paulkaplan thanks!

Was this page helpful?
0 / 5 - 0 ratings