public ActionResult LanguageSelector()
 {
     var model = new LanguageSelectorModel();
     model.CurrentLanguage = _workContext.WorkingLanguage.ToModel();
     model.AvailableLanguages = _languageService
         .GetAllLanguages(storeId: _storeContext.CurrentStore.Id)
         .Select(x => x.ToModel())
         .ToList();
     return PartialView(model);
 }
예제 #2
0
 public ActionResult LanguageSelected(int customerlanguage)
 {
     var language = _languageService.GetLanguageById(customerlanguage);
     if (language != null)
     {
         _workContext.WorkingLanguage = language;
     }
     var model = new LanguageSelectorModel();
     model.CurrentLanguage = _workContext.WorkingLanguage.ToModel();
     model.AvailableLanguages = _languageService.GetAllLanguages().Select(x => x.ToModel()).ToList();
     return PartialView("LanguageSelector", model);
 }