.NET Framework Resource model
To make applications localizable the .NET Framework provides a resource model that allows developers to easily manage user interface elements, but also any other localizable formats like images or audio.
The model is extensible two ways:
- First, any serializable object can be part of resources, so to make a new object type localizable all the developer has to do is provide object serialization for the respective class.
- Second, the resource model can also be used to access resources which are not in the standard binary resource format, for example a database.
Text format (.txt)
The simplest source format for resources is a text format which allows developers to create string resources as name/value pairs separated by equal signs. The file needs to be in UTF-8 or UTF-16 encoding. But because this file format limited to only one resource type and not specifically supported as a resource source format in the development environment it is usually recommended to use the richer ResX XML format.
ResX XML format (.resx)
ResX is an XML format defined for the .NET Framework which allows all resource types to be represented in the source file. Binary resources like images are stored in base64 encoding. One big advantage of it being an XML file is that it can be modified with any XML editor or localized with any XML localization tool. The other advantage is that there is no ambiguity about what the file character encoding is and that Unicode content is supported by default.
ResX is used as the resource source format in the Windows Forms editor and also has build support in Visual Studio .NET. More on this further ahead in the text.