internal static Localization Deserialize(JsonObject jsonObject) { var codepage = jsonObject.GetValueOrDefault("codepage", 0); var culture = jsonObject.GetValueOrDefault <string>("culture"); var variables = new Dictionary <string, BindVariable>(); var variablesJson = jsonObject.GetValueOrDefault("variables", new JsonArray()); foreach (JsonObject variableJson in variablesJson) { var bindPath = BindVariable.Deserialize(variableJson); variables.Add(bindPath.Id, bindPath); } var controls = new Dictionary <string, LocalizedControl>(); var controlsJson = jsonObject.GetValueOrDefault <JsonObject>("controls"); if (controlsJson != null) { foreach (var controlJsonWithKey in controlsJson) { var control = LocalizedControl.Deserialize((JsonObject)controlJsonWithKey.Value); controls.Add(controlJsonWithKey.Key, control); } } return(new Localization(codepage, culture, variables, controls)); }