Example #1
0
        public static String GetTranslatedText(String moduleName, String languagePair, String trnKey, String defaultText)
        {
            if (String.IsNullOrWhiteSpace(moduleName))
            {
                throw new ArgumentNullException("moduleName");
            }

            if (String.IsNullOrWhiteSpace(trnKey))
            {
                throw new ArgumentNullException("trnKey");
            }

            if (String.IsNullOrWhiteSpace(languagePair))
            {
                throw new ArgumentNullException("languagePair");
            }

            var translatedText = TranslationCache.GetTranslatedText(moduleName, languagePair, trnKey, defaultText);

            return(translatedText);
        }
Example #2
0
        public static List <TranslationContract> GetTranslations(String moduleName, String languagePair, List <TranslationContract> list)
        {
            var @set   = new HashSet <String>();
            var result = new List <TranslationContract>();

            foreach (var contract in list)
            {
                if (String.IsNullOrWhiteSpace(contract.TrnKey))
                {
                    continue;
                }

                if ([email protected](contract.TrnKey))
                {
                    continue;
                }

                contract.TranslatedText = TranslationCache.GetTranslatedText(moduleName, languagePair, contract.TrnKey, contract.DefaultText);
                result.Add(contract);
            }

            return(result);
        }