pxt-arcade icon indicating copy to clipboard operation
pxt-arcade copied to clipboard

Changing language may break the game

Open manuq opened this issue 1 year ago • 5 comments

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):

  • OS: Linux (Endless OS)
  • Browser: Google Chrome
  • Version: 120.0.6099.71

manuq avatar Dec 19 '23 15:12 manuq

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

Jaqster avatar Jan 20 '24 00:01 Jaqster

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?

manuq avatar Jan 21 '24 21:01 manuq

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 avatar Jan 22 '24 05:01 ganicke

Here's the behavior in blocks:

ezgif-4-c04aa4837c

ganicke avatar Jan 24 '24 01:01 ganicke

@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".

manuq avatar Jan 24 '24 21:01 manuq