Skip to content

Update language dialog and remove MakeCode's own menu entry #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Jul 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions bin/update-translations.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* 1. Path to CreateAI tool translation strings directory.
* 2. Path to machine-learning-strings.json translation strings directory.
*
* To only update MakeCode block translations, pass path to
* machine-learning-strings.json translation strings directory as an argument.
* To only update CreateAI tool translations, pass path to CreateAI tool
* translation strings directory as an argument.
*
* Manually run `npm run i18n:compile` after.
*
Expand Down Expand Up @@ -55,7 +55,7 @@ if (args.length === 0 || args.length > 2) {
}

const [createAiTranslationsFilepath, mlTranslationsFilepath] =
args.length === 1 ? [null, args[0]] : args;
args.length === 1 ? [args[0], null] : args;

languages.forEach((language) => {
const lowerLang = language.toLowerCase();
Expand All @@ -76,10 +76,14 @@ languages.forEach((language) => {
: `${createAiTranslationsFilepath}/${language}/ui.en.json`;
const langMessages = getFileJSONContent(srcLangFilepath);

const mlFilepath = `${mlTranslationsFilepath}/${language}/machine-learning-strings.json`;
const mlStrings = getFileJSONContent(mlFilepath);
// Update machine learning strings.
let messagesToAdd = {}
if (mlTranslationsFilepath) {
const mlFilepath = `${mlTranslationsFilepath}/${language}/machine-learning-strings.json`;
const mlStrings = getFileJSONContent(mlFilepath);
messagesToAdd = getMessagesToAdd(mlStrings, langMessages);
}

const messagesToAdd = getMessagesToAdd(mlStrings, langMessages);
fs.writeFileSync(
outputFilepath,
JSON.stringify({ ...langMessages, ...messagesToAdd })
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,30 @@
"defaultMessage": "Idioma",
"description": "Language option text"
},
"language-fully-supported-heading": {
"defaultMessage": "Fully supported",
"description": "Fully supported languages heading text"
},
"language-partially-supported-heading": {
"defaultMessage": "Partially supported",
"description": "Partially supported languages heading text"
},
"language-support-checked": {
"defaultMessage": "Compatible",
"description": "Aria label for ticked checkbox for language support"
},
"language-support-unchecked": {
"defaultMessage": "Incompatible",
"description": "Aria label for unticked checkbox for language support"
},
"language-supported-for": {
"defaultMessage": "Traduccions compatibles per a:",
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
},
"language-toast-title": {
"defaultMessage": "L'idioma no està disponible totalment",
"description": "Language support toast notification title"
},
"learn-about-firewall-requirements-action": {
"defaultMessage": "Més informació sobre els requisits del tallafoc",
"description": "Link to support article for firewall requirements"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.en.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,30 @@
"defaultMessage": "Language",
"description": "Language option text"
},
"language-fully-supported-heading": {
"defaultMessage": "Fully supported",
"description": "Fully supported languages heading text"
},
"language-partially-supported-heading": {
"defaultMessage": "Partially supported",
"description": "Partially supported languages heading text"
},
"language-support-checked": {
"defaultMessage": "Supported",
"description": "Aria label for ticked checkbox for language support"
},
"language-support-unchecked": {
"defaultMessage": "Unsupported",
"description": "Aria label for unticked checkbox for language support"
},
"language-supported-for": {
"defaultMessage": "Translations supported for:",
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
},
"language-toast-title": {
"defaultMessage": "Language not fully supported",
"description": "Language support toast notification title"
},
"learn-about-firewall-requirements-action": {
"defaultMessage": "Learn about firewall requirements",
"description": "Link to support article for firewall requirements"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.es-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,30 @@
"defaultMessage": "Idioma",
"description": "Language option text"
},
"language-fully-supported-heading": {
"defaultMessage": "Fully supported",
"description": "Fully supported languages heading text"
},
"language-partially-supported-heading": {
"defaultMessage": "Partially supported",
"description": "Partially supported languages heading text"
},
"language-support-checked": {
"defaultMessage": "Admitidas",
"description": "Aria label for ticked checkbox for language support"
},
"language-support-unchecked": {
"defaultMessage": "No admitidas",
"description": "Aria label for unticked checkbox for language support"
},
"language-supported-for": {
"defaultMessage": "Traducciones admitidas para:",
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
},
"language-toast-title": {
"defaultMessage": "El idioma no es soportado totalmente",
"description": "Language support toast notification title"
},
"learn-about-firewall-requirements-action": {
"defaultMessage": "Conoce los requisitos del cortafuegos",
"description": "Link to support article for firewall requirements"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,30 @@
"defaultMessage": "言語",
"description": "Language option text"
},
"language-fully-supported-heading": {
"defaultMessage": "Fully supported",
"description": "Fully supported languages heading text"
},
"language-partially-supported-heading": {
"defaultMessage": "Partially supported",
"description": "Partially supported languages heading text"
},
"language-support-checked": {
"defaultMessage": "対応",
"description": "Aria label for ticked checkbox for language support"
},
"language-support-unchecked": {
"defaultMessage": "非対応",
"description": "Aria label for unticked checkbox for language support"
},
"language-supported-for": {
"defaultMessage": "サポートされている翻訳:",
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
},
"language-toast-title": {
"defaultMessage": "言語が完全にサポートされていません",
"description": "Language support toast notification title"
},
"learn-about-firewall-requirements-action": {
"defaultMessage": "ファイアウォール要件について調べる",
"description": "Link to support article for firewall requirements"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,30 @@
"defaultMessage": "언어 선택",
"description": "Language option text"
},
"language-fully-supported-heading": {
"defaultMessage": "Fully supported",
"description": "Fully supported languages heading text"
},
"language-partially-supported-heading": {
"defaultMessage": "Partially supported",
"description": "Partially supported languages heading text"
},
"language-support-checked": {
"defaultMessage": "지원됨",
"description": "Aria label for ticked checkbox for language support"
},
"language-support-unchecked": {
"defaultMessage": "지원되지 않음",
"description": "Aria label for unticked checkbox for language support"
},
"language-supported-for": {
"defaultMessage": "지원되는 번역:",
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
},
"language-toast-title": {
"defaultMessage": "언어가 완전히 지원되지 않습니다",
"description": "Language support toast notification title"
},
"learn-about-firewall-requirements-action": {
"defaultMessage": "방화벽 요구 사항에 대해 알아보기",
"description": "Link to support article for firewall requirements"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.lol.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,30 @@
"defaultMessage": "crwdns363064:0crwdne363064:0",
"description": "Language option text"
},
"language-fully-supported-heading": {
"defaultMessage": "crwdns366275:0crwdne366275:0",
"description": "Fully supported languages heading text"
},
"language-partially-supported-heading": {
"defaultMessage": "crwdns366277:0crwdne366277:0",
"description": "Partially supported languages heading text"
},
"language-support-checked": {
"defaultMessage": "crwdns366279:0crwdne366279:0",
"description": "Aria label for ticked checkbox for language support"
},
"language-support-unchecked": {
"defaultMessage": "crwdns366281:0crwdne366281:0",
"description": "Aria label for unticked checkbox for language support"
},
"language-supported-for": {
"defaultMessage": "crwdns366283:0crwdne366283:0",
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
},
"language-toast-title": {
"defaultMessage": "crwdns366285:0crwdne366285:0",
"description": "Language support toast notification title"
},
"learn-about-firewall-requirements-action": {
"defaultMessage": "crwdns363066:0crwdne363066:0",
"description": "Link to support article for firewall requirements"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,30 @@
"defaultMessage": "Taal",
"description": "Language option text"
},
"language-fully-supported-heading": {
"defaultMessage": "Fully supported",
"description": "Fully supported languages heading text"
},
"language-partially-supported-heading": {
"defaultMessage": "Partially supported",
"description": "Partially supported languages heading text"
},
"language-support-checked": {
"defaultMessage": "Ondersteund",
"description": "Aria label for ticked checkbox for language support"
},
"language-support-unchecked": {
"defaultMessage": "Niet ondersteund",
"description": "Aria label for unticked checkbox for language support"
},
"language-supported-for": {
"defaultMessage": "Vertalingen ondersteund voor:",
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
},
"language-toast-title": {
"defaultMessage": "Taal niet volledig ondersteund",
"description": "Language support toast notification title"
},
"learn-about-firewall-requirements-action": {
"defaultMessage": "Meer informatie over firewall vereisten",
"description": "Link to support article for firewall requirements"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,30 @@
"defaultMessage": "Język",
"description": "Language option text"
},
"language-fully-supported-heading": {
"defaultMessage": "Fully supported",
"description": "Fully supported languages heading text"
},
"language-partially-supported-heading": {
"defaultMessage": "Partially supported",
"description": "Partially supported languages heading text"
},
"language-support-checked": {
"defaultMessage": "Wspierane",
"description": "Aria label for ticked checkbox for language support"
},
"language-support-unchecked": {
"defaultMessage": "Niewspierany",
"description": "Aria label for unticked checkbox for language support"
},
"language-supported-for": {
"defaultMessage": "Tłumaczenia wspierane dla:",
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
},
"language-toast-title": {
"defaultMessage": "Język nie w pełni obsługiwany",
"description": "Language support toast notification title"
},
"learn-about-firewall-requirements-action": {
"defaultMessage": "Dowiedz się więcej o wymaganiach firewall",
"description": "Link to support article for firewall requirements"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,30 @@
"defaultMessage": "Idioma",
"description": "Language option text"
},
"language-fully-supported-heading": {
"defaultMessage": "Fully supported",
"description": "Fully supported languages heading text"
},
"language-partially-supported-heading": {
"defaultMessage": "Partially supported",
"description": "Partially supported languages heading text"
},
"language-support-checked": {
"defaultMessage": "Auxiliado",
"description": "Aria label for ticked checkbox for language support"
},
"language-support-unchecked": {
"defaultMessage": "Não auxiliado",
"description": "Aria label for unticked checkbox for language support"
},
"language-supported-for": {
"defaultMessage": "Traduções suportadas para:",
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
},
"language-toast-title": {
"defaultMessage": "O idioma possui suporte parcial",
"description": "Language support toast notification title"
},
"learn-about-firewall-requirements-action": {
"defaultMessage": "Saiba mais sobre os requisitos de firewall.",
"description": "Link to support article for firewall requirements"
Expand Down
24 changes: 24 additions & 0 deletions lang/ui.zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,30 @@
"defaultMessage": "語言",
"description": "Language option text"
},
"language-fully-supported-heading": {
"defaultMessage": "Fully supported",
"description": "Fully supported languages heading text"
},
"language-partially-supported-heading": {
"defaultMessage": "Partially supported",
"description": "Partially supported languages heading text"
},
"language-support-checked": {
"defaultMessage": "Supported",
"description": "Aria label for ticked checkbox for language support"
},
"language-support-unchecked": {
"defaultMessage": "Unsupported",
"description": "Aria label for unticked checkbox for language support"
},
"language-supported-for": {
"defaultMessage": "Translations supported for:",
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
},
"language-toast-title": {
"defaultMessage": "Language not fully supported",
"description": "Language support toast notification title"
},
"learn-about-firewall-requirements-action": {
"defaultMessage": "瞭解防火牆要求",
"description": "Link to support article for firewall requirements"
Expand Down
3 changes: 3 additions & 0 deletions src/components/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import React, { forwardRef } from "react";
import { useProject } from "../hooks/project-hooks";
import { getMakeCodeLang } from "../settings";
import { useSettings } from "../store";
import { getEditorVersionOverride } from "../editor-version";

const controllerId = "MicrobitMachineLearningTool";

Expand All @@ -27,10 +28,12 @@ const Editor = forwardRef<MakeCodeFrameDriver, EditorProps>(function Editor(
return (
<MakeCodeFrame
ref={ref}
queryParams={{ hidelanguage: "1" }}
controllerId={controllerId}
controller={2}
lang={getMakeCodeLang(languageId)}
loading="eager"
version={getEditorVersionOverride()}
{...editorCallbacks}
{...props}
/>
Expand Down
Loading