Skip to content

Instantly share code, notes, and snippets.

@ashour
Last active April 23, 2020 12:36
Show Gist options
  • Save ashour/a8a8160133b673ab7a4ec8c45dfd14fd to your computer and use it in GitHub Desktop.
Save ashour/a8a8160133b673ab7a4ec8c45dfd14fd to your computer and use it in GitHub Desktop.
using System.Globalization;
using System.Threading;
using System.Web.Mvc;
namespace I18nDemo.Controllers
{
public class BaseController : Controller
{
protected override void OnActionExecuting(
ActionExecutingContext filterContext)
{
base.OnActionExecuting(filterContext);
var cultureInfo = CultureInfo.GetCultureInfo("ar");
Thread.CurrentThread.CurrentCulture = cultureInfo;
Thread.CurrentThread.CurrentUICulture = cultureInfo;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment