Ejemplo n.º 1
0
        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);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
		public LocalizedGossipMenuItem(GossipMenuIcon icon, LangKey langKey, GossipActionHandler callback)
			: this(langKey)
		{
			Icon = icon;
			Action = new DefaultGossipAction(callback);
		}
Ejemplo n.º 3
0
		public LocalizedGossipMenuItem(GossipMenuIcon icon, LangKey langKey, IGossipAction action)
			: this(langKey)
		{
			Icon = icon;
			Action = action;
		}
Ejemplo n.º 4
0
		public LocalizedGossipMenuItem(GossipMenuIcon icon, LangKey langKey, params LocalizedGossipMenuItem[] items)
			: this(langKey)
		{
			Icon = icon;
			SubMenu = new GossipMenu(items);
		}
Ejemplo n.º 5
0
		public LocalizedGossipMenuItem(LangKey langKey, params LocalizedGossipMenuItem[] items)
			: this(langKey)
		{
			SubMenu = new GossipMenu(items);
		}
Ejemplo n.º 6
0
		public LocalizedGossipMenuItem(LangKey langKey, IGossipAction action, GossipMenu subMenu)
			: this(langKey)
		{
			Action = action;
			SubMenu = subMenu;
		}
Ejemplo n.º 7
0
		public LocalizedGossipMenuItem(LangKey langKey, GossipActionHandler callback, GossipMenu subMenu)
			: this(langKey)
		{
			Action = new DefaultGossipAction(callback);
			SubMenu = subMenu;
		}
Ejemplo n.º 8
0
		public LocalizedGossipMenuItem(LangKey langKey, GossipMenu subMenu)
			: this(langKey, (IGossipAction)null, subMenu)
		{
		}
Ejemplo n.º 9
0
		public LocalizedGossipMenuItem(LangKey langKey, GossipActionHandler callback, params LocalizedGossipMenuItem[] items)
			: this(langKey)
		{
			Action = new DefaultGossipAction(callback);
			SubMenu = new GossipMenu(items);
		}
Ejemplo n.º 10
0
		public LocalizedGossipMenuItem(LangKey langKey, GossipActionHandler callback, LangKey confirmLangKey)
			: this(langKey)
		{
			ConfirmTexts = RealmLocalizer.Instance.GetTranslations(confirmLangKey);
			Action = new DefaultGossipAction(callback);
		}
Ejemplo n.º 11
0
		public LocalizedGossipMenuItem(LangKey langKey, IGossipAction action)
			: this(langKey)
		{
			Action = action;
		}
Ejemplo n.º 12
0
		public LocalizedGossipMenuItem(LangKey langKey)
			: this(GossipMenuIcon.Talk, langKey)
		{
		}
Ejemplo n.º 13
0
		public LocalizedGossipMenuItem(GossipMenuIcon type, LangKey langKey)
		{
			Icon = type;
			Texts = RealmLocalizer.Instance.GetTranslations(langKey);
		}
Ejemplo n.º 14
0
		public static void ReplyFormat(this CmdTrigger<RealmServerCmdArgs> trigger, LangKey key, params object[] args)
		{
			trigger.ReplyFormat(RealmLocalizer.Instance.Translate(trigger.GetLocale(), key, args));
		}
Ejemplo n.º 15
0
		public static string Translate(this CmdTrigger<RealmServerCmdArgs> trigger, LangKey key, params object[] args)
		{
			return RealmLocalizer.Instance.Translate(trigger.GetLocale(), key, args);
		}