Last post Apr 21, 2012 08:40 AM by francesco abbruzzese
Apr 18, 2012 03:29 PM|u84six|LINK
Can someone point me to a nice clean solution to making an ASP.NET MVC 4 (or 3) application globalized/localized?
I have no idea why it's so hard to find a standard solution. Isn't globalization one of the first things you think about when you build an app?
Anyhow, I want to use resource.resx files and not multiple views. I'd rather organize the strings rather than tons of views.
Apr 18, 2012 03:43 PM|u84six|LINK
Apr 18, 2012 04:59 PM|ignatandrei|LINK
Apr 18, 2012 05:06 PM|u84six|LINK
Thanks for the link, I'll check that out. Is it really that open-ended? Kind of surprised that there's no MS instructions. I haven't been able to find much on msdn.
Apr 18, 2012 05:11 PM|ignatandrei|LINK
it's not part of MVC or webforms.
It;s part of ASP.NET( Or , if you want, of .NET)
Apr 20, 2012 10:52 PM|u84six|LINK
I'm not so sure about that. It's part of everything. For example, if you're working with the Razor view engine, you need to know that @Resources.resource.<key> is the syntax to access your string resource. I just wish there was a clean and preferred way
to support internationalization in MVC, but the few solutions I've found aren't very good. Looks like I'll have to grind through it and create my own implementation.
Application templates in VS should already be 'ready' for internationalization. No one makes web apps in one language anymore.
Apr 21, 2012 08:40 AM|francesco abbruzzese|LINK
To achieve internazionalization you need just to handle smartly resource files. Don't forget of the error messages contained in the validation attributes, and of the string contained in all meta data such as Display attribute. All can be specified in resource
files instead of being inserted directly. .
Substantially this is all! If you use the default settings of globalization asp.net will autodetect the language of the browser and will choose the right language...then you can allow the user to change it manually(by changing the current UI culture of the
current thread), and set its preferences in a cookie.