microsoft / pxt-arcade

Arcade game editor based on Microsoft MakeCode
https://arcade.makecode.com
MIT License
482 stars 209 forks source link

Changing language may break the game #6289

Open manuq opened 11 months ago

manuq commented 11 months ago

Describe the bug I did a game with the editor in Spanish (MX). Then I switched to English and the game was broken. It seems Sprite bottom (translated as "abajo" in Spanish) ends up replaced by Sprite x in a couple of places. I did a minimum example where the bug can be reproduced: https://github.com/manuq/language-bug

To Reproduce Steps to reproduce the behavior:

  1. With the Arcade editor in Spanish (MX), load from this repo: https://github.com/manuq/language-bug
  2. See the fruit correctly stopping when it reaches the bottom of the screen
  3. Change editor language to English
  4. See the fruit falling off the screen

Expected behavior The game should work consistently regardless of the language.

Screenshots Here are the blocks in Spanish: Captura de pantalla de 2023-12-19 11-45-01

And then after switching to English they become: Captura de pantalla de 2023-12-19 11-45-45

Desktop (please complete the following information):

Jaqster commented 10 months ago

The issue here is that "mySprite.bottom/abajo" is translating back to "mySprite.x"

manuq commented 9 months ago

The issue here is that "mySprite.bottom/abajo" is translating back to "mySprite.x"

Yes, but is this a translation issue? I would expect that the code is decoupled from the translations. Isn't this the case in Arcade?

ganicke commented 9 months ago

It does this for both Spanish locales but works OK for the other languages. It seems to want to reset to the first property get() on sprites. The property will not change if left in the context of the JavaScript editor when the language is changed. Investigating further...

ganicke commented 9 months ago

Here's the behavior in blocks:

ezgif-4-c04aa4837c

manuq commented 9 months ago

@ganicke exactly! Thanks for picturing the bug. Going from Spanish to English the "down" property is replaced by the "x" property in some blocks. Going back to Spanish the property is left as "x".