CurrentCulture incorrectly defaulting to en-US in ASP.net

These are alternative places where you could search: I can’t find anywhere that’s settings the culture to ‘en-US’… but something is. Thread.CurrentThread.CurrentCulture.Name is outputting ‘en-US’ Thread.CurrentThread.CurrentCulture.NumberFormat.CurrencySymbol is outputting ‘$’ Try looking for the InitializeCulture method, this method is overridden in ASP.Net pages to set the Culture like: protected override void InitializeCulture() { var hidden = … Read more

Can You Determine Timezone from Request Variables?

This is more complicated but I’ve had to resort to this scenario before because machine and user profile settings sometimes don’t match your visitor’s preferences. For example, a UK visitor accessing your site temporarily from an Australian server. Use a geolocation service (e.g MaxMind.com) as suggested by @balabaster, to get the zone matching their IP … Read more

ASP.NET – MVC 3: Localization

Then I found a post that warned about using the App_GlobalResouces and App_LocalResources. (Link) I found that post extremely useful. The method explained there is very clean. Here is a snippet of my newly created index view using that method: @using Resources.Index @{ ViewBag.Title = “Index”; } <h1>@Index.Title</h1> I don’t think there is a definitive … Read more

.resx vs database vs custom solution for providing Localization/Globalization

Rick Strahl (An MS MVP) has a great tool kit for managing localization via the DB – offer the ability to update and modify on demand through a controlled environment and does much of the heavy lifting for you. Histoolkit offer the following features: Data Driven Localization Resource Provider Database driven Localization lets you store … Read more

Are there built-in Month name declensions in C#

You can obtain months’ names in two cases, Nominative: DateTimeFormatInfo info = CultureInfo.GetCultureInfo(“ru-RU”).DateTimeFormat; // February: 2 – 1 (array is zero based) – “Февраль” Console.Write(info.MonthNames[2 – 1]); And Genitive: // February: 2 – 1 (array is zero based) – “февраля” Console.Write(info.MonthGenitiveNames[2 – 1]); Other cases (e.g. Dative, Accusative) are not supported and we have to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)