Skip to content

Added localization#4

Open
Tokessa wants to merge 6 commits into
kieler:mainfrom
Tokessa:localization
Open

Added localization#4
Tokessa wants to merge 6 commits into
kieler:mainfrom
Tokessa:localization

Conversation

@Tokessa

@Tokessa Tokessa commented Jun 8, 2026

Copy link
Copy Markdown
  • 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread backend/backend.js
Comment thread frontend/localization.js
Comment thread frontend/localization.js
Comment thread backend/tokens_de.js
Comment thread backend/tokens_en.js
Comment thread frontend/style.css
Comment thread frontend/main.js
Comment thread package.json
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"
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can target node 24 as the current LTS release

Comment thread frontend/main.js
Comment thread frontend/main.js
Comment thread backend/executor/build_and_run_deploy.sh
Comment thread backend/executor/build_and_run.sh
Comment thread backend/tokens_de.js
Comment thread backend/tokens_de.js
Comment thread backend/tokens_en.js
Comment thread backend/tokens_de.js
Comment thread backend/tokens_de.js
Comment thread backend/tokens_de.js
Comment thread backend/tokens_de.js
Comment thread backend/tokens_de.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants