Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET core razor pages localization for inputmodel inside pagemodel

I have created a Resources folder inside my ASP.NET Core solution and have created resx files for translations. I have resx files for models, pages and controllers. I would like to know where to put a resx file inside the Resources folder when there is a inputmodel inside a pagemodel?

like image 493
user2262068 Avatar asked Jul 08 '18 20:07

user2262068


1 Answers

This is an old question and maybe not relevant now, but I just had the same problem and was able to figure it out, so I'll add what worked for me.

It is really just a minor detail. If we want the resource for the page model, we would have Resources\Pages\IndexModel.en.resx, for a class that's internal to that page model, we add a +InnerModel, ending up with Resources\Pages\IndexModel+InnerModel.en.resx

I created a GitHub repository with a working sample here -> https://github.com/joaofbantunes/AspNetCoreRazorPagesInnerModelLocalizationSample

like image 182
joaofbantunes Avatar answered Oct 23 '22 14:10

joaofbantunes