Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resource (.resx) file Key naming conventions?

I'm building a C# app that will likely contain a couple resource files to store strings for use in language translation. I'm trying to come up with a naming convention for the Keys in my resouce files. Has anyone tackled this before me?

like image 351
Dawsy Avatar asked May 22 '09 04:05

Dawsy


People also ask

What are naming conventions for files?

A File Naming Convention (FNC) is a framework for naming your files in a way that describes what they contain and how they relate to other files. Developing an FNC is done through identifying the key elements of the project, the important differences and commonalities between your files.

What is a resources RESX file?

resx resource file format consists of XML entries, which specify objects and strings inside XML tags. It contains a standard set of header information, which describes the format of the resource entries and specifies the versioning information for the XML used to parse the data.

What is a .resx file and how do you use it?

Resource file used by programs developed with Microsoft's . NET Framework; stores objects and strings for a program in an XML format; may contain both plain text information as well as binary data, which is encoded as text within the XML tags.


1 Answers

Just use Pascal naming convention. Dont attribute the key to a module or the class. Generalize it so that it can be reused.

Eg: ReadWriteWarningMessage

The dot separated convention works fine for menu items. But what about strings that are generated dynamically or user messages.

like image 118
bobbyalex Avatar answered Sep 20 '22 08:09

bobbyalex