0
votes

Looking around I see a lot of articles about localization in ASP.NET MVC, but they all do the same thing - setup a .resx file, set its build action to the right tool to make sure a class with static string properties is created, then use that class.

Is there any way at all to use an existing resource provider I already have? Or at the very least somehow have those .resx files live outside the main assembly (not in App_GlobalResources)?

Edit: valid question raised below - why can't I just use my resource provider? the thing is it works, but breaks my tests as HttpContext is null in those. If there is a way to fetch my global resources via the resource provider without calling HttpContext.GetGlobalResourceObject that would most likely be a good solution.

2

2 Answers

0
votes

You could always move all of your localized stuff into a separate project and just reference that project from your MVC project. Would that work for you?

0
votes

Why not just use the resource provider you already have, then? I'm not understanding why you can't just make calls against it as you would in another project.