Skip to content

Commit 6be7b4d

Browse files
Update language dialog to include MakeCode (#598)
- Fixes #580 (via option 1 in issue) - Add flag for translationPreview for previewing CreateAI UI translations - Add `editorVersion` param for configuring MakeCode version - Update language dialog to have partially supported and fully supported sections - Add Guarani and Vietnamese languages - Tweak translation sync script to only update tool translations when 1 argument is passed. I think we are more likely to update the tool translations only (without the machine learning extension strings). - Change language dialog scroll behaviour to outside instead of inside
1 parent 1df0a14 commit 6be7b4d

29 files changed

+1052
-60
lines changed

bin/update-translations.cjs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
* 1. Path to CreateAI tool translation strings directory.
99
* 2. Path to machine-learning-strings.json translation strings directory.
1010
*
11-
* To only update MakeCode block translations, pass path to
12-
* machine-learning-strings.json translation strings directory as an argument.
11+
* To only update CreateAI tool translations, pass path to CreateAI tool
12+
* translation strings directory as an argument.
1313
*
1414
* Manually run `npm run i18n:compile` after.
1515
*
@@ -55,7 +55,7 @@ if (args.length === 0 || args.length > 2) {
5555
}
5656

5757
const [createAiTranslationsFilepath, mlTranslationsFilepath] =
58-
args.length === 1 ? [null, args[0]] : args;
58+
args.length === 1 ? [args[0], null] : args;
5959

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

79-
const mlFilepath = `${mlTranslationsFilepath}/${language}/machine-learning-strings.json`;
80-
const mlStrings = getFileJSONContent(mlFilepath);
79+
// Update machine learning strings.
80+
let messagesToAdd = {}
81+
if (mlTranslationsFilepath) {
82+
const mlFilepath = `${mlTranslationsFilepath}/${language}/machine-learning-strings.json`;
83+
const mlStrings = getFileJSONContent(mlFilepath);
84+
messagesToAdd = getMessagesToAdd(mlStrings, langMessages);
85+
}
8186

82-
const messagesToAdd = getMessagesToAdd(mlStrings, langMessages);
8387
fs.writeFileSync(
8488
outputFilepath,
8589
JSON.stringify({ ...langMessages, ...messagesToAdd })

lang/ui.ca.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,30 @@
871871
"defaultMessage": "Idioma",
872872
"description": "Language option text"
873873
},
874+
"language-fully-supported-heading": {
875+
"defaultMessage": "Fully supported",
876+
"description": "Fully supported languages heading text"
877+
},
878+
"language-partially-supported-heading": {
879+
"defaultMessage": "Partially supported",
880+
"description": "Partially supported languages heading text"
881+
},
882+
"language-support-checked": {
883+
"defaultMessage": "Compatible",
884+
"description": "Aria label for ticked checkbox for language support"
885+
},
886+
"language-support-unchecked": {
887+
"defaultMessage": "Incompatible",
888+
"description": "Aria label for unticked checkbox for language support"
889+
},
890+
"language-supported-for": {
891+
"defaultMessage": "Traduccions compatibles per a:",
892+
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
893+
},
894+
"language-toast-title": {
895+
"defaultMessage": "L'idioma no està disponible totalment",
896+
"description": "Language support toast notification title"
897+
},
874898
"learn-about-firewall-requirements-action": {
875899
"defaultMessage": "Més informació sobre els requisits del tallafoc",
876900
"description": "Link to support article for firewall requirements"

lang/ui.en.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,30 @@
871871
"defaultMessage": "Language",
872872
"description": "Language option text"
873873
},
874+
"language-fully-supported-heading": {
875+
"defaultMessage": "Fully supported",
876+
"description": "Fully supported languages heading text"
877+
},
878+
"language-partially-supported-heading": {
879+
"defaultMessage": "Partially supported",
880+
"description": "Partially supported languages heading text"
881+
},
882+
"language-support-checked": {
883+
"defaultMessage": "Supported",
884+
"description": "Aria label for ticked checkbox for language support"
885+
},
886+
"language-support-unchecked": {
887+
"defaultMessage": "Unsupported",
888+
"description": "Aria label for unticked checkbox for language support"
889+
},
890+
"language-supported-for": {
891+
"defaultMessage": "Translations supported for:",
892+
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
893+
},
894+
"language-toast-title": {
895+
"defaultMessage": "Language not fully supported",
896+
"description": "Language support toast notification title"
897+
},
874898
"learn-about-firewall-requirements-action": {
875899
"defaultMessage": "Learn about firewall requirements",
876900
"description": "Link to support article for firewall requirements"

lang/ui.es-es.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,30 @@
871871
"defaultMessage": "Idioma",
872872
"description": "Language option text"
873873
},
874+
"language-fully-supported-heading": {
875+
"defaultMessage": "Fully supported",
876+
"description": "Fully supported languages heading text"
877+
},
878+
"language-partially-supported-heading": {
879+
"defaultMessage": "Partially supported",
880+
"description": "Partially supported languages heading text"
881+
},
882+
"language-support-checked": {
883+
"defaultMessage": "Admitidas",
884+
"description": "Aria label for ticked checkbox for language support"
885+
},
886+
"language-support-unchecked": {
887+
"defaultMessage": "No admitidas",
888+
"description": "Aria label for unticked checkbox for language support"
889+
},
890+
"language-supported-for": {
891+
"defaultMessage": "Traducciones admitidas para:",
892+
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
893+
},
894+
"language-toast-title": {
895+
"defaultMessage": "El idioma no es soportado totalmente",
896+
"description": "Language support toast notification title"
897+
},
874898
"learn-about-firewall-requirements-action": {
875899
"defaultMessage": "Conoce los requisitos del cortafuegos",
876900
"description": "Link to support article for firewall requirements"

lang/ui.ja.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,30 @@
871871
"defaultMessage": "言語",
872872
"description": "Language option text"
873873
},
874+
"language-fully-supported-heading": {
875+
"defaultMessage": "Fully supported",
876+
"description": "Fully supported languages heading text"
877+
},
878+
"language-partially-supported-heading": {
879+
"defaultMessage": "Partially supported",
880+
"description": "Partially supported languages heading text"
881+
},
882+
"language-support-checked": {
883+
"defaultMessage": "対応",
884+
"description": "Aria label for ticked checkbox for language support"
885+
},
886+
"language-support-unchecked": {
887+
"defaultMessage": "非対応",
888+
"description": "Aria label for unticked checkbox for language support"
889+
},
890+
"language-supported-for": {
891+
"defaultMessage": "サポートされている翻訳:",
892+
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
893+
},
894+
"language-toast-title": {
895+
"defaultMessage": "言語が完全にサポートされていません",
896+
"description": "Language support toast notification title"
897+
},
874898
"learn-about-firewall-requirements-action": {
875899
"defaultMessage": "ファイアウォール要件について調べる",
876900
"description": "Link to support article for firewall requirements"

lang/ui.ko.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,30 @@
871871
"defaultMessage": "언어 선택",
872872
"description": "Language option text"
873873
},
874+
"language-fully-supported-heading": {
875+
"defaultMessage": "Fully supported",
876+
"description": "Fully supported languages heading text"
877+
},
878+
"language-partially-supported-heading": {
879+
"defaultMessage": "Partially supported",
880+
"description": "Partially supported languages heading text"
881+
},
882+
"language-support-checked": {
883+
"defaultMessage": "지원됨",
884+
"description": "Aria label for ticked checkbox for language support"
885+
},
886+
"language-support-unchecked": {
887+
"defaultMessage": "지원되지 않음",
888+
"description": "Aria label for unticked checkbox for language support"
889+
},
890+
"language-supported-for": {
891+
"defaultMessage": "지원되는 번역:",
892+
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
893+
},
894+
"language-toast-title": {
895+
"defaultMessage": "언어가 완전히 지원되지 않습니다",
896+
"description": "Language support toast notification title"
897+
},
874898
"learn-about-firewall-requirements-action": {
875899
"defaultMessage": "방화벽 요구 사항에 대해 알아보기",
876900
"description": "Link to support article for firewall requirements"

lang/ui.lol.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,30 @@
871871
"defaultMessage": "crwdns363064:0crwdne363064:0",
872872
"description": "Language option text"
873873
},
874+
"language-fully-supported-heading": {
875+
"defaultMessage": "crwdns366275:0crwdne366275:0",
876+
"description": "Fully supported languages heading text"
877+
},
878+
"language-partially-supported-heading": {
879+
"defaultMessage": "crwdns366277:0crwdne366277:0",
880+
"description": "Partially supported languages heading text"
881+
},
882+
"language-support-checked": {
883+
"defaultMessage": "crwdns366279:0crwdne366279:0",
884+
"description": "Aria label for ticked checkbox for language support"
885+
},
886+
"language-support-unchecked": {
887+
"defaultMessage": "crwdns366281:0crwdne366281:0",
888+
"description": "Aria label for unticked checkbox for language support"
889+
},
890+
"language-supported-for": {
891+
"defaultMessage": "crwdns366283:0crwdne366283:0",
892+
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
893+
},
894+
"language-toast-title": {
895+
"defaultMessage": "crwdns366285:0crwdne366285:0",
896+
"description": "Language support toast notification title"
897+
},
874898
"learn-about-firewall-requirements-action": {
875899
"defaultMessage": "crwdns363066:0crwdne363066:0",
876900
"description": "Link to support article for firewall requirements"

lang/ui.nl.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,30 @@
871871
"defaultMessage": "Taal",
872872
"description": "Language option text"
873873
},
874+
"language-fully-supported-heading": {
875+
"defaultMessage": "Fully supported",
876+
"description": "Fully supported languages heading text"
877+
},
878+
"language-partially-supported-heading": {
879+
"defaultMessage": "Partially supported",
880+
"description": "Partially supported languages heading text"
881+
},
882+
"language-support-checked": {
883+
"defaultMessage": "Ondersteund",
884+
"description": "Aria label for ticked checkbox for language support"
885+
},
886+
"language-support-unchecked": {
887+
"defaultMessage": "Niet ondersteund",
888+
"description": "Aria label for unticked checkbox for language support"
889+
},
890+
"language-supported-for": {
891+
"defaultMessage": "Vertalingen ondersteund voor:",
892+
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
893+
},
894+
"language-toast-title": {
895+
"defaultMessage": "Taal niet volledig ondersteund",
896+
"description": "Language support toast notification title"
897+
},
874898
"learn-about-firewall-requirements-action": {
875899
"defaultMessage": "Meer informatie over firewall vereisten",
876900
"description": "Link to support article for firewall requirements"

lang/ui.pl.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,30 @@
871871
"defaultMessage": "Język",
872872
"description": "Language option text"
873873
},
874+
"language-fully-supported-heading": {
875+
"defaultMessage": "Fully supported",
876+
"description": "Fully supported languages heading text"
877+
},
878+
"language-partially-supported-heading": {
879+
"defaultMessage": "Partially supported",
880+
"description": "Partially supported languages heading text"
881+
},
882+
"language-support-checked": {
883+
"defaultMessage": "Wspierane",
884+
"description": "Aria label for ticked checkbox for language support"
885+
},
886+
"language-support-unchecked": {
887+
"defaultMessage": "Niewspierany",
888+
"description": "Aria label for unticked checkbox for language support"
889+
},
890+
"language-supported-for": {
891+
"defaultMessage": "Tłumaczenia wspierane dla:",
892+
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
893+
},
894+
"language-toast-title": {
895+
"defaultMessage": "Język nie w pełni obsługiwany",
896+
"description": "Language support toast notification title"
897+
},
874898
"learn-about-firewall-requirements-action": {
875899
"defaultMessage": "Dowiedz się więcej o wymaganiach firewall",
876900
"description": "Link to support article for firewall requirements"

lang/ui.pt-br.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,30 @@
871871
"defaultMessage": "Idioma",
872872
"description": "Language option text"
873873
},
874+
"language-fully-supported-heading": {
875+
"defaultMessage": "Fully supported",
876+
"description": "Fully supported languages heading text"
877+
},
878+
"language-partially-supported-heading": {
879+
"defaultMessage": "Partially supported",
880+
"description": "Partially supported languages heading text"
881+
},
882+
"language-support-checked": {
883+
"defaultMessage": "Auxiliado",
884+
"description": "Aria label for ticked checkbox for language support"
885+
},
886+
"language-support-unchecked": {
887+
"defaultMessage": "Não auxiliado",
888+
"description": "Aria label for unticked checkbox for language support"
889+
},
890+
"language-supported-for": {
891+
"defaultMessage": "Traduções suportadas para:",
892+
"description": "Text introducing list of translated areas for a given language (areas: Microsoft MakeCode, micro:bit CreateAI UI itself)"
893+
},
894+
"language-toast-title": {
895+
"defaultMessage": "O idioma possui suporte parcial",
896+
"description": "Language support toast notification title"
897+
},
874898
"learn-about-firewall-requirements-action": {
875899
"defaultMessage": "Saiba mais sobre os requisitos de firewall.",
876900
"description": "Link to support article for firewall requirements"

0 commit comments

Comments
 (0)