From abaac1b92628a4d567b7993ad37d419e7872c5b4 Mon Sep 17 00:00:00 2001 From: "Evan W. Patton" Date: Wed, 8 Mar 2017 12:37:10 -0500 Subject: [PATCH] Add function guard to generated messages JavaScript --- i18n/create_messages.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/i18n/create_messages.py b/i18n/create_messages.py index d32814f4a..435b9d162 100755 --- a/i18n/create_messages.py +++ b/i18n/create_messages.py @@ -111,7 +111,10 @@ goog.provide('Blockly.Msg.{0}'); goog.require('Blockly.Msg'); -""".format(target_lang.replace('-', '.'))) +Blockly.Msg.{0}.switch_blockly_language_to_{1} = {{ +init: function() {{ + +""".format(target_lang.replace('-', '.'), target_lang.replace('-', '_'))) # For each key in the source language file, output the target value # if present; otherwise, output the source language value with a # warning comment. @@ -140,6 +143,7 @@ goog.require('Blockly.Msg'); filename, ', '.join(synonym_keys))) outfile.write(synonym_text) + outfile.write("\n\n}\n};\n") if not args.quiet: print('Created {0}.'.format(outname))