private void btnAC_Click(object sender, EventArgs e) { //Gets all available Languages for conversion string route = "/languages?api-version=3.0"; var Client = new RestClient(AppData.endpoint_var); var Request = new RestRequest(route, Method.GET); //Get the raw Json response var Response = Client.Execute(Request); //Parse the Json and store in dictionary var dict = JsonConvert.DeserializeObject <IDictionary>(Response.Content); //Adding the Languages to the drop down menu and id to the list foreach (DictionaryEntry entry in dict) { Console.WriteLine(entry.Key + ": " + entry.Value); if (entry.Key.Equals("translation")) { var AC = (JObject)entry.Value; AvailLangs = new List <string>(); comboAvailableLangs.Items.Clear(); foreach (var LangKey in AC) { if (!LangKey.Equals(lblSrcLang.Text)) { var LangName = (JObject)LangKey.Value; foreach (var x in LangName) { if (x.Key == "name") { //Populating the drop down Menu comboAvailableLangs.Items.Add(x.Value); } } //Storing the language ids in the list for further use AvailLangs.Add(LangKey.Key); } } } } }
public LocalizedGossipMenuItem(GossipMenuIcon icon, LangKey langKey, GossipActionHandler callback) : this(langKey) { Icon = icon; Action = new DefaultGossipAction(callback); }
public LocalizedGossipMenuItem(GossipMenuIcon icon, LangKey langKey, IGossipAction action) : this(langKey) { Icon = icon; Action = action; }
public LocalizedGossipMenuItem(GossipMenuIcon icon, LangKey langKey, params LocalizedGossipMenuItem[] items) : this(langKey) { Icon = icon; SubMenu = new GossipMenu(items); }
public LocalizedGossipMenuItem(LangKey langKey, params LocalizedGossipMenuItem[] items) : this(langKey) { SubMenu = new GossipMenu(items); }
public LocalizedGossipMenuItem(LangKey langKey, IGossipAction action, GossipMenu subMenu) : this(langKey) { Action = action; SubMenu = subMenu; }
public LocalizedGossipMenuItem(LangKey langKey, GossipActionHandler callback, GossipMenu subMenu) : this(langKey) { Action = new DefaultGossipAction(callback); SubMenu = subMenu; }
public LocalizedGossipMenuItem(LangKey langKey, GossipMenu subMenu) : this(langKey, (IGossipAction)null, subMenu) { }
public LocalizedGossipMenuItem(LangKey langKey, GossipActionHandler callback, params LocalizedGossipMenuItem[] items) : this(langKey) { Action = new DefaultGossipAction(callback); SubMenu = new GossipMenu(items); }
public LocalizedGossipMenuItem(LangKey langKey, GossipActionHandler callback, LangKey confirmLangKey) : this(langKey) { ConfirmTexts = RealmLocalizer.Instance.GetTranslations(confirmLangKey); Action = new DefaultGossipAction(callback); }
public LocalizedGossipMenuItem(LangKey langKey, IGossipAction action) : this(langKey) { Action = action; }
public LocalizedGossipMenuItem(LangKey langKey) : this(GossipMenuIcon.Talk, langKey) { }
public LocalizedGossipMenuItem(GossipMenuIcon type, LangKey langKey) { Icon = type; Texts = RealmLocalizer.Instance.GetTranslations(langKey); }
public static void ReplyFormat(this CmdTrigger<RealmServerCmdArgs> trigger, LangKey key, params object[] args) { trigger.ReplyFormat(RealmLocalizer.Instance.Translate(trigger.GetLocale(), key, args)); }
public static string Translate(this CmdTrigger<RealmServerCmdArgs> trigger, LangKey key, params object[] args) { return RealmLocalizer.Instance.Translate(trigger.GetLocale(), key, args); }