Added localization#4
Open
Tokessa wants to merge 6 commits into
Open
Conversation
Tokessa
commented
Jun 8, 2026
- Added a language selector button to the website (German and English available).
- Added functionality to close the settings menu when clicking outside of it.
- Updated the warning system to allow multiple warnings to be displayed simultaneously.
There was a problem hiding this comment.
Pull request overview
This PR introduces basic localization (German/English) to the RailBlocks UI and Blockly blocks, adds a language selector to the frontend, improves menu behavior (close on outside click), and refactors the warning system to support multiple concurrent warnings per block.
Changes:
- Add localization infrastructure (token tables, language selection, localized toolbox + UI labels).
- Add language selector UI (icon + menu) and outside-click handling for language/settings menus.
- Refactor workspace initialization (restore on reload) and update block warning logic to support multiple warning sources.
Reviewed changes
Copilot reviewed 10 out of 15 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds ESLint-related dev dependencies. |
| package-lock.json | Introduces lockfile capturing dependency tree (incl. ESLint). |
| frontend/style.css | Adds shared button styling and language menu styles. |
| frontend/main.js | Applies stored language, localizes UI/toolbox, adds language menu logic, workspace save/restore, and multi-warning support. |
| frontend/localization.js | New localization helper that applies Blockly locale + custom RailBlocks messages and exposes label getters. |
| frontend/index.html | Adds language switcher UI and IDs used for localized label injection. |
| frontend/icons/language.svg | Adds language icon used by the new selector button. |
| frontend/dynamic_blocks.js | Replaces hardcoded English strings with localized Blockly.Msg.* tokens. |
| frontend/blocks.js | Switches JSON block texts/tooltips to %{BKY_...} tokens and generates toolbox from localized labels. |
| backend/tokens_en.js | Adds English token table for custom block strings/tooltips/warnings. |
| backend/tokens_de.js | Adds German token table for custom block strings/tooltips/warnings. |
| backend/executor/build_and_run.sh | Whitespace-only change. |
| backend/executor/build_and_run_deploy.sh | Whitespace-only change. |
| backend/backend.js | Removes an import (but currently breaks runtime due to exec still being used). |
| .gitignore | Adds ignore rules for Node/build artifacts and generated outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
21
to
26
| "devDependencies": { | ||
| "@eslint/js": "^10.0.1", | ||
| "eslint": "^10.4.0", | ||
| "globals": "^17.6.0", | ||
| "typescript-eslint": "^8.34.1" | ||
| } |
Member
There was a problem hiding this comment.
we can target node 24 as the current LTS release
Eddykasp
requested changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.