mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-08-06 11:29:16 -04:00
Merge pull request #1784 from cwillisf/setLocale-always-refreshBlocks
Make setLocale consistently refresh blocks
This commit is contained in:
commit
05979e2e93
1 changed files with 2 additions and 3 deletions
|
@ -1036,10 +1036,9 @@ class VirtualMachine extends EventEmitter {
|
|||
* updated for a new locale (or empty if locale hasn't changed.)
|
||||
*/
|
||||
setLocale (locale, messages) {
|
||||
if (locale === formatMessage.setup().locale) {
|
||||
return Promise.resolve();
|
||||
if (locale !== formatMessage.setup().locale) {
|
||||
formatMessage.setup({locale: locale, translations: {[locale]: messages}});
|
||||
}
|
||||
formatMessage.setup({locale: locale, translations: {[locale]: messages}});
|
||||
return this.extensionManager.refreshBlocks();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue