Culture Types and Localizing Resource Files
The LocalStrings.resx resource file is an embedded resource for the primary culture of the
assembly. To make this happen as part of the Visual Studio assembly build process, the Properties
window for the LocalStrings.resx file has its Build Action property set to Embedded Resource.
Figure 13-13 shows the compilation process and how it converts the .resx file to a binary resource
file before it embeds it in the assembly.
Figure 13-13. Compiling a resource file and embedding it in an assembly
The default culture for the LocalStrings resource is determined by the value of the
AssemblyCulture assembly-level attribute:
[assembly: AssemblyCulture("")]
CHAPTER 13 ?– P ACKAGI NG AND DEPLOYMENT 701
The blank value specified in the control library code indicates the use of the invariant culture.
The invariant culture is the fallback culture that is used to resolve a lookup by ResourceManager
if no other culture is specified or a culture cannot be matched using available resources.
Because we want to provide more than just an English version of output for our controls,
we have to provide additional resource files that are localized for the cultures we want to support.
We do this by creating a resource file with the same resource name as LocalStrings but with a
language and/or culture/region as part of the filename right before the filename extension.
Pages:
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894