The .NET framework provides a family of classes that are designed to make resource management consistent and easy. These classes are as follows:
ResourceManager is used to manage all resources in an application.
ResourceSet represents a collection of all the resources for a particular culture.
ResourceReader is an implementation class for the IResourceReader interface. This is used to read resources from a stream.
ResourceWriter is an implementation of the IResourceWriter interface. This are used to write resources to a stream.
Your application must use a ResourceManager to load the resource assemblies and make them available to the rest of the program. The ResourceManager will return a ResourceSet for a given culture.
Different cultures and languages are identified through the CultureInfo class. This class is a simple information store that contains data about the culture selected by the user when he or she installed the operating system. It contains information about the language, calendar, currency, and other preferences that the user might have chosen. Your software will have access to this information so that it can determine whether it has the ability to offer culture-specific resources or must choose the neutral default value.
Being culture specific might be very important in the message you are trying to deliver. There is an anecdote that illustrates why.
Culture information about languages is provided by a two-letter code and an optional region identifier that accompanies the two letter code. For example, the neutral English language is represented by the two letter code en, but the different flavors of English—English from England, Canada, the United States and other places—is identified by the sub-codes GB, CA, US, and so on.
Listing 3.4.1 shows a program that will get the CultureInfo for your computer and display the language and region that applies to your computer. It also shows the full name of the culture and which calendar your current culture is using.
52.14.76.12