jodidragonfly
New Member
I am currently working on a product of ours that is an MVC 3 based project. The product was recently slated for launch in Canada where there are laws requiring all websites to provide both English and French versions of the copy.The basic architecture consists of:- A loclaization class library- The MVC3 application- A DAL - All controllers inherit from a base localizable controller class that sets the current thread's CurrentCulture and CurrentUICulture to the proper language. This is working great (borrowed from Scott Hansel's code).- Also it has a basic REST API that called via jQuery from the UI. I have all the Views working as desired but I am having issues in getting the action to return the proper language for messages. The API controller actions do not return ActionResults instead they return a JSON string. I do not believe this to be the culprit of my pains though.I am currently trying to leverage the ResourceManager object with no luck. Here is the latest code I have tried. Note that CultureName is a property provided by the BaseLocalizableController object.\[code\]var rm = new ResourceManager("ProductXYZ.Localization.App_GlobalResources.Messages", Assembly.Load("ProductXYZ.Localization"));viewModel.Message = rm.GetString("SuccessfullySaveChanges", CultureInfo.CreateSpecificCulture(user.Language ?? CultureName));\[/code\]The GetString function is always returning English, event when it should be returning French. I know that there is something fundamental I am missing here, but just haven't been able to locate it and I am now up against a hard deadline.Any assistance would be greatly appreciated.Thanks