Skip to content

Commit

Permalink
chore: upgrade to Blockly v11 (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
gonfunko authored May 22, 2024
1 parent 94d2a2c commit 9e01bc5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
24 changes: 12 additions & 12 deletions msg/scratch_msgs.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import * as Blockly from 'blockly';
import * as Blockly from 'blockly/core';

const ScratchMsgs = {
currentLocale_: 'en',
setLocale: function(locale) {
export class ScratchMsgs {
static currentLocale_ = 'en';
static locales = {};

static setLocale(locale) {
if (Object.keys(this.locales).includes(locale)) {
this.currentLocale_ = locale;
Blockly.Msg = Object.assign({}, Blockly.Msg, this.locales[locale]);
Object.assign(Blockly.Msg, this.locales[locale]);
} else {
// keep current locale
console.warn('Ignoring unrecognized locale: ' + locale);
}
},
translate: function(msgId, defaultMsg, useLocale) {
}

static translate(msgId, defaultMsg, useLocale) {
var locale = useLocale || this.currentLocale_;

if (Object.keys(this.locales).includes(locale)) {
Expand All @@ -21,9 +24,8 @@ const ScratchMsgs = {
}
}
return defaultMsg;
},
locales: {},
};
}
}

ScratchMsgs.locales["ab"] =
{
Expand Down Expand Up @@ -22985,5 +22987,3 @@ ScratchMsgs.locales["zh-tw"] =
"DEFAULT_BROADCAST_MESSAGE_NAME": "message1"
};
// End of combined translations

export {ScratchMsgs};
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"@blockly/continuous-toolbox": "^5.0.15",
"@blockly/field-angle": "^4.0.2",
"@blockly/field-colour": "^4.0.2",
"blockly": "^11.0.0-beta.11"
"blockly": "^11.0.0"
}
}

0 comments on commit 9e01bc5

Please sign in to comment.