public List <TransfluentTranslation> knownTextEntries(string groupid = null)
        {
            if (currentLanguage == null)
            {
                throw new Exception("Must set current language first!");
            }

            var getAllKeys = new GetAllExistingTranslationKeys(currentLanguage.id, groupid);

            var list = new List <TransfluentTranslation>();

            try
            {
                Dictionary <string, TransfluentTranslation> dictionaryOfKeys = getAllKeys.Parse(makeCall(getAllKeys));
                foreach (KeyValuePair <string, TransfluentTranslation> transfluentTranslation in dictionaryOfKeys)
                {
                    list.Add(transfluentTranslation.Value);
                }
            }
            catch (ApplicatonLevelException errorcode)
            {
                //Debug.Log("App error:"+errorcode);
                if (errorcode.details.type != 400.ToString())
                {
                    throw;
                }
            }
            return(list);
        }
示例#2
0
        public void testListAllTranslations()
        {
            var getAllKeys = new GetAllExistingTranslationKeys(englishLanguage.id);

            Dictionary <string, TransfluentTranslation> translations = getAllKeys.Parse(justCall(getAllKeys));

            Assert.IsNotNull(translations);
            Assert.Greater(translations.Count, 0);

            getAllKeys = new GetAllExistingTranslationKeys(backwardsLanguage.id);
            Dictionary <string, TransfluentTranslation> backwardsTranslations = getAllKeys.Parse(justCall(getAllKeys));

            Assert.IsNotNull(backwardsTranslations);
            Assert.Greater(backwardsTranslations.Count, 0);

            Assert.IsTrue(backwardsTranslations.ContainsKey(TRANSLATION_KEY));
        }
        public List<TransfluentTranslation> knownTextEntries(string groupid = null)
        {
            if(currentLanguage == null) throw new Exception("Must set current language first!");

            var getAllKeys = new GetAllExistingTranslationKeys(currentLanguage.id, groupid);

            var list = new List<TransfluentTranslation>();
            try
            {
                Dictionary<string, TransfluentTranslation> dictionaryOfKeys = getAllKeys.Parse(makeCall(getAllKeys));
                foreach(KeyValuePair<string, TransfluentTranslation> transfluentTranslation in dictionaryOfKeys)
                {
                    list.Add(transfluentTranslation.Value);
                }
            }
            catch(ApplicatonLevelException errorcode)
            {
                //Debug.Log("App error:"+errorcode);
                if(errorcode.details.type != 400.ToString())
                {
                    throw;
                }
            }
            return list;
        }
        public void testListAllTranslations()
        {
            var getAllKeys = new GetAllExistingTranslationKeys(englishLanguage.id);

            Dictionary<string, TransfluentTranslation> translations = getAllKeys.Parse(justCall(getAllKeys));
            Assert.IsNotNull(translations);
            Assert.Greater(translations.Count, 0);

            getAllKeys = new GetAllExistingTranslationKeys(backwardsLanguage.id);
            Dictionary<string, TransfluentTranslation> backwardsTranslations = getAllKeys.Parse(justCall(getAllKeys));
            Assert.IsNotNull(backwardsTranslations);
            Assert.Greater(backwardsTranslations.Count, 0);

            Assert.IsTrue(backwardsTranslations.ContainsKey(TRANSLATION_KEY));
        }