Esempio n. 1
0
        public async Task UpdateLanguages(string language)
        {
            var newCulture = new CultureInfo(SupportedLanguages.
                                             First(x => x.Value == language).Key);
            var prevCulture = new CultureInfo(SupportedLanguages.
                                              First(x => x.Value == CurrentLanguage).Key);

            if (newCulture.Name.ToLower() != prevCulture.Name.ToLower())
            {
                await Localizer.ChangeCulture(newCulture);

                foreach (var viewModel in MultilangualViewModels)
                {
                    viewModel.UpdateLanguage();
                }

                CurrentLanguage = SupportedLanguages[newCulture.Name.ToLower()];
            }
        }