I made the change that you suggested but it did not resolved the problem :(
@{ var topicService = Nop.Core.Infrastructure.EngineContext.Current.Resolve<ITopicService>(); var localizeService = Nop.Core.Infrastructure.EngineContext.Current.Resolve<ILocalizationService>(); var currentContext = Nop.Core.Infrastructure.EngineContext.Current.Resolve<IWorkContext>(); }
@foreach (var topic in topicService.GetAllTopics()) {
if (topic.TypeId.Equals("Area")) { <li> <a href="@Url.RouteUrl("Topic", new { SystemName = topic.SystemName })">@localizeService.GetResource(topic.Title, currentContext.WorkingLanguage.Id)</a> </li> }
}
Do you see any problem in this code (the currentContext.WorkingLanguage.Id is returning the correct ids)?
@{ var topicService = Nop.Core.Infrastructure.EngineContext.Current.Resolve<ITopicService>(); var localizeService = Nop.Core.Infrastructure.EngineContext.Current.Resolve<ILocalizationService>(); var currentContext = Nop.Core.Infrastructure.EngineContext.Current.Resolve<IWorkContext>(); }
@foreach (var topic in topicService.GetAllTopics()) { <li> <a href="@Url.RouteUrl("Topic", new { SystemName = topic.SystemName })">@topic.GetLocalized(x=>x.Title,currentContext.WorkingLanguage.Id)</a> </li> } }