protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
base.OnActionExecuting(filterContext);
if (RouteData.Values.First().Value != null)
{
try
{
if (RouteData.Values.First().Value.ToString() == "tr")
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
ViewBag.DilKisaltmasi = "tr";
ViewBag.DilID = db.Dils.GetirDilID("tr");
Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
}
if (RouteData.Values.First().Value.ToString() == "en")
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
ViewBag.DilKisaltmasi = "en";
ViewBag.DilID = db.Dils.GetirDilID("en");
}
if (RouteData.Values.First().Value.ToString() == "de")
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE");
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
ViewBag.DilKisaltmasi = "de";
ViewBag.DilID = db.Dils.GetirDilID("de");
Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
}
if (RouteData.Values.First().Value.ToString() == "ru")
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("ru-RU");
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
ViewBag.DilKisaltmasi = "ru";
ViewBag.DilID = db.Dils.GetirDilID("ru");
Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
}
// Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
}
catch (Exception ex)
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
ViewBag.DilKisaltmasi = "tr";
ViewBag.DilID = db.Dils.GetirDilID("tr");
Thread.CurrentThread.CurrentCulture.NumberFormat.NumberDecimalSeparator = ".";
}
}
}
Yazar: Ali Karayel
Makale Tarihi: 07.11.2017 Gücellenme Tarihi: 07.11.2017

Yorum Yaz

Yorumlarınız denetimden geçtikten sonra yayınlanmaktadır...