0

In my MVC app, I've created areas for each language. Inside controllers/views of each area I want specific culture to be used.

I have area for TR and EN. I've modified the web.config files for the areas but seems MVC isn't respecting this setting. When I read current culture it displays en-US.

This is what I've tried: areas/tr/views/web.config

<system.web>
    <globalization uiCulture="tr-TR" culture="tr-TR" />
</system.web>

Any proper way to set desired culture for the area?

HasanG
  • 12,734
  • 29
  • 100
  • 154
  • Do your localized areas all have different page structures? If not, see [ASP.NET MVC 5 culture in route and url](https://stackoverflow.com/a/32839796/) for a more maintainable way to localize your site. – NightOwl888 Oct 22 '17 at 21:06
  • @NightOwl888 Seems too much code for something that simple :). My areas contain translated UI elements and custom attribute routes. – HasanG Oct 23 '17 at 11:50
  • That is just it, you have made it difficult to maintain by using areas for this (unless of course the navigation structure of each area is completely different, then this is the right way to go). Typically, you store the localized text in resources and load them into the *same view* and use the *same controller*, so the only thing that differs between culture are the resource files. – NightOwl888 Oct 23 '17 at 12:00

0 Answers0