hedyorg / hedy

Hedy is a gradual programming language to teach children programming. Gradual languages use different language levels, where each level adds new concepts and syntactic complexity. At the end of the Hedy level sequence, kids master a subset of syntactically valid Python.
https://www.hedy.org
European Union Public License 1.2
1.26k stars 282 forks source link

🖊️ Preserve language of booleans and numbers in output #5548

Open boryanagoncharenko opened 1 month ago

boryanagoncharenko commented 1 month ago

Language idea incl level In level 15 and up, we have support for boolean values. Unlike other literal values, booleans can be printed. And since #5547, the output is always the translated boolean keyword in the selected language instead of the literal value that was actually used in the program:

# lang is Bulgarian
a = True
print a
# outputs 'вярно'

Similarly, when the current language is Arabic, numbers are automatically converted to even when the numbers in the original program are Latin:

# lang is Arabic
print 1 + 1
# outputs `٢`

Instead, we would like to be able to preserve the original value (True in the former snippet and 2 in the latter)