예제 #1
0
        public List <Locale> getAvailableLocales()
        {
            List <Locale> availableLocales = new List <Locale>();

            List <Language> languages;

            try
            {
                languages = LanguageDao.FindAll();
            }
            catch (InstanceNotFoundException <Language> ex)
            {
                throw new InternalErrorException(ex);
            }

            foreach (Language language in languages)
            {
                foreach (Country country in language.Countries)
                {
                    availableLocales.Add(new Locale(language.languageCode, country.countryCode));
                }
            }

            return(availableLocales);
        }
예제 #2
0
        public Dictionary <string, string> getAvailableLanguages()
        {
            Dictionary <string, string> availableLanguages = new Dictionary <string, string>();

            List <Language> languages;

            try
            {
                languages = LanguageDao.FindAll();
            }
            catch (InstanceNotFoundException <Language> ex)
            {
                throw new InternalErrorException(ex);
            }

            foreach (Language language in languages)
            {
                availableLanguages.Add(language.languageCode, language.languageName);
            }

            return(availableLanguages);
        }