parameters: (filename)
return_statement: return constants_text
docstring: Read in constants file, which must be output in every language.
docstring_summary: Read in constants file, which must be output in every language.
docstring_tokens: Read in constants file which must be output in every language .
function: def load_constants(filename):
    """Read in constants file, which must be output in every language."""
    constant_defs = read_json_file(filename);
    constants_text = '\n'
    for key in constant_defs:
      value = constant_defs[key]
      value = value.replace('"', '\\"')
      constants_text += '\nBlockly.Msg["{0}"] = "{1}";'.format(key, value)
    return constants_text
function_tokens: def load_constants ( filename ) : constant_defs = read_json_file ( filename ) constants_text = '\n' for key in constant_defs : value = constant_defs [ key ] value = value . replace ( '"' , '\\"' ) constants_text += '\nBlockly.Msg["{0}"] = "{1}";' . format ( key , value ) return constants_text