microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
721 stars 593 forks source link

Changing language to Italian sets all play tone block notes to Middle C #4905

Closed martinwork closed 1 year ago

martinwork commented 1 year ago

Describe the bug Changing language to Italian sets all play tone block notes to Middle C

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on 'New project'
  3. Ensure language is English
  4. Add some 'play tone' blocks, with various notes
  5. Change language to Italian
  6. See error

Expected behavior play tone blocks retain their note values when the language is changed.

Screenshots image image

micro:bit version (please complete the following information): not hardware related

Desktop (please complete the following information):

martinwork commented 1 year ago

Reported in support ticket https://support.microbit.org/helpdesk/tickets/59496 (private)

kimprice commented 1 year ago

This also happens when going from Italian back to English.

jwunderl commented 1 year ago

The issue should be https://crowdin.com/translate/makecode/65/en-it?filter=basic&value=0#17298 swapping the field name (name to note). I added a check to discard translations that broke things a few years back but it must be missing a case for this one, easiest to start looking from there: https://github.com/microsoft/pxt/blob/addWebUsbDisabledHelpButton/pxtlib/service.ts#L765

Note that fixing this will probably mean notes break in italian, so we'll most likely want to add an upgrade rule in this check: https://github.com/microsoft/pxt-microbit/blob/master/editor/patch.ts#L45 (and probably fix by making hasEquivalentParameters reject this block rather than fixing the translation, cause getting rid of the broken translation I linked will immediately break all those projects)