Stopping C# language internationalization
I've got a C# .NET program here with the following line for开发者_C百科 loading strings:
m_resource_manager = new ResourceManager("Foo.FooStrings", Assembly.GetExecutingAssembly());
as was recommended to me. Right now, I've got a request to stop doing these translations, and do everything in English. I want to make changes as low-impact and reversible as possible.
I'd like to change this line so it always loads the English string table, but I don't know what to specify, or for that matter whether this is a good way or not.
Is this a good way to stick to English? If so, how should I write it? If not, what should I do instead?
You can specify culture right before this string:
#if ENGLISH_ONLY
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-GB");
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
#endif
Then if you compile assembly with ENGLISH_ONLY
symbol all loading strings will be in English.
can you not just remove all resx files but the default which can be in English?
精彩评论