scratchfoundation / scratchfoundation/scratch-blocks

Restrictors & localization of numbers

Open
#664 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature localization needs-discussion
Dominant language
JavaScript
Stars
2.8k
Forks
1.6k
Avg merge
4h 51m
Merged PRs (30d)
12

Description

Currently scratch-blocks restrictors restrict typing decimal numbers to the "." character.

A comment from @cpseager:

"Hard coding with . is not great for future localisation for languages such as French and German that use comma as the decimal separator. Scratch 2 never supported European numbers correctly, but it would be great if Scratch 3 did!"

Blockly also has this problem - since its validators use JavaScript to force numbers.

The VM also wouldn't know how to deal with , separated numbers right now. How could we deal with this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the scratch-blocks restrictors, Blockly validators, and VM number handling named in the issue. Determine how localized decimal separators should be represented across those components and define the expected behavior for French and German-style numbers. The work is done when localized input is accepted and handled consistently without breaking existing decimal-number behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
localization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.