Last active
April 23, 2020 12:36
-
-
Save ashour/a8a8160133b673ab7a4ec8c45dfd14fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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