views:

216

answers:

1

We're looking to use resource files (.resx) in an ASP.NET app for storing localized values. There may be thousands of strings in total across the site which we'll want to store.

Is there a best practice for organizing values in to one or more resource files? Do you keep all values in one file? Do you separate in to multiple resource files based on subject matter? Perhaps there's a common resource file for the site's common values i.e. "Ok", "Continue", etc?

It seems storing all resources in a single file will be overbearing for maintaining.

Any suggestions?

+2  A: 

Yes, one single file seems like a bad choice in a moderately-sized app or bigger :-)

We basically use this approach:

  • each webform has its own local resources for buttons, labels and so forth
  • there are a number of global resources, organized by topic - e.g. a "general" resource for things like "yes", "no", and so forth; one for error messages that keep popping up all over the place, and so forth - a few global resources based on area of use
  • any other code (more business code rather than ASPX/ASCX code behind) has their own resource files

It's always a balancing act between having hoodles of files vs. having files with way too many entries, though :-)

Marc

marc_s