I have a .Net 3.5 application written mostly in C# that uses .resx files to store internationalization data for several different languages, consisting of strings, control sizes and positions, etc. What I'm trying to figure out is this: it is possible to compile my application in such a way that the default culture data will be pulled out into a satellite assembly in much the same way as the other culture data?
I'm trying to prevent a situatio开发者_开发技巧n where the user uses the software in one (non-default) language, removes the culture folder in the bin directory, and then has access to the default language.
If this is impractical or impossible due to framework limitations, is it possible to perhaps compile in a language other than the default, so that I could give a single, non-default version of the application to the user?
Thanks so much for your answers.
I did something similar just a few days ago, because I needed all my app's assemblies to have access to the same resources. You just need to create a separate assembly containing the resources, and reference it from your app's assemblies. Note that if you do that, the resource assembly won't be a satellite assembly: it willbe explicitly referenced from other assemblies, and the app won't start at all if it's not present.
Also note that by default the resources classes generated by Visual Studio are internal. To make them public, you need to replace the custom tool ResxFileCodeGenerator
with PublicResxFileCodeGenerator
.
精彩评论