From 4ba7e9373fa87a7dd9d32a3e2bfd16134d93eb29 Mon Sep 17 00:00:00 2001 From: chrisgarrity Date: Wed, 18 Jul 2018 09:52:55 -0400 Subject: [PATCH] Add function to return the current VM/blocks locale --- src/virtual-machine.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/virtual-machine.js b/src/virtual-machine.js index d73d8ce7e..d2e5f929e 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -927,6 +927,14 @@ class VirtualMachine extends EventEmitter { return this.extensionManager.refreshBlocks(); } + /** + * get the current locale for the VM + * @returns {string} the current locale in the VM + */ + getLocale () { + return formatMessage.setup().locale; + } + /** * Handle a Blockly event for the current editing target. * @param {!Blockly.Event} e Any Blockly event.