コード例 #1
0
        public static string EngToSpanish(string EngWord)
        {
            //nu am gasit cuvantul in dictionarul ENGtoEsp
            if (!EngToEsp.ContainsKey(EngWord))
            {
                string found2 = EngWord;
                //il caut in dictionarul eng franceza
                string found = EnglishToFrench.EngToFrench(EngWord);

                // if (found != EngWord) FrenchToSpanish.FrancezaSpaniola(found);

                if (FrenchToSpanish.FrancezaSpaniola(found) != found)
                {
                    found2 = FrenchToSpanish.FrancezaSpaniola(found);
                }
                return(found2);
            }
            else
            {
                return(EngToEsp[EngWord]);
            }
        }
コード例 #2
0
        public static string Translate(string input, string fromLanguage, string toLanguage)
        {
            string output = "";

            if (fromLanguage == "English" && toLanguage == "French")
            {
                return(output = EnglishToFrench.EnglezaFranceza(input));
            }

            if (fromLanguage == "French" && toLanguage == "English")
            {
                return(output = FrenchToEnglish.FrancezaEngleza(input));
            }

            if (fromLanguage == "English" && toLanguage == "Spanish")
            {
                return(output = EnglishToSpanish.EnglezaSpaniola(input));
            }

            if (fromLanguage == "Spanish" && toLanguage == "English")
            {
                return(output = SpanishToEnglish.SpaniolaEngleza(input));
            }

            if (fromLanguage == "French" && toLanguage == "Spanish")
            {
                return(output = FrenchToSpanish.FrancezaSpaniola(input));
            }

            if (fromLanguage == "Spanish" && toLanguage == "French")
            {
                return(output = SpanishToFrench.SpaniolaFranceza(input));
            }



            return(output);
        }