A trivial question perhaps, but I'm interested in the answers. I'm currently refactoring some very large monolithic string resource files (one dumpster resource file per project, in about 30 projects). I'm splitting them such that we follow a convention for our files and make the strings easier to find and manage when coding.
Generally I'm splitting the files into this scheme:
I'm not terribly thrilled with the naming, and I'm just wondering what other people use. For example, instead of AppResources (strings for internal use by the application), I've seen a lot of demo projects use StringResources, Internal (terrible!), etc.
Ideas/anecdotes/suggestions on managing resources or standard naming schemes are appreciated.
I generally structure my resources like this:
The first resource file is used by the entire application (e.g. Project.Core) and does include all sorts of widely used common strings. I actually don't make any difference between errors/exceptions and logging:
CommonResources.resxError_ContextError_ArgumentCannotBeNull
Warn_ContextWarn_ApplicationSettingNotFoundUseDefault
Info_ContextInfo_UpdateAvailable
Validation_ContextValidation_EmailNotValid
The second resource file is used by the presentation layer and contains all sorts of UI strings. The naming can vary from project to project but generally it looks like the following schema:
PresentationResources.resxCommon_ContextCommon_Yes
Section/Controller_Window/View_ContextHelp_FAQ_HeadlineHowToUseResources or Help_FAQ_TextHowToUseResources
Finally every project/assembly does also have an internal resource file for Error/Warn/Info/Validation resources that are too specific to go in the CommonResources.resx file. I have to admit, that I mostly name this resource file InternalResources.cs ;)
InternalResources.resxClassname_Error_ContextBCrypt_Error_InvalidSaltRevision
Classname_Warn_ContextClassname_Info_ContextClassname_Validation_ContextIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With