[Mono-winforms-list] Important ResourceManager notes

Kornél Pál kornelpal at hotmail.com
Fri Jun 10 16:33:56 EDT 2005


> From: "Rafael Teixeira"
> Kornel you are not understanting Peter words.
> It says Managed.Windows.Forms RUNS in german in MS.NET!!!

Here is several hours later and I was too tired to understand.:)) But now I
understand what you mean.:)

> From: "Peter Dennis Bartok"
> I mean that when I compile the Mono System.Windows.Forms.dll sources with
> VS.Net, linking in the neutral as well as the EN and DE resources into the
> assembly (not satellite or whatever, just the regular dll that also
> contains
> all the code), and I use the resulting DLL with the winforms/messagebox
> application, I get localized buttons, so it is obviously reading the
> non-neutral, localized resources from the main assembly.

You are right that you will be able to use both English and German resources
when you compile it using Visual Studio .NET but it's because VS.NET is
smart enough to create satellite assemblies automatically for each culture.

Try the attached project.
Compile it using VS.NET. You will get the result in bin\... and there will
be a "hu" directory with the satellite assembly. You can examine the exe
with ildasm to see that there is only the neutral resuorce, no Hungarian.

Then compile it using build.bat (I included this exe variant in the zip
precompiled).
It will create the exe in the directory of sources. There will be no
satellite assemblies and it will contain the Hungarian resources as well.
You can examine it using ildasm.

Neutral resource contains a single resource named "CultureName" with the
value "neutral".
Hungarian resource contains a single resource named "CultureName" with the
value "hu".

InternalGetResourceSet falls back to neutral (in fact parent) resources if
you haven't got the appropriate satellite assembly and GetString falls back
to neutral (in fact parent) resources if you have the appropriate satellite
resource but it does not contain the requested string.

You can examine the output of the exe.

Kornél
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ResourceManagerCultureTest.zip
Type: application/x-zip-compressed
Size: 6409 bytes
Desc: not available
Url : http://galactus.ximian.com/pipermail/mono-winforms-list/attachments/20050610/cd20f726/ResourceManagerCultureTest.bin


More information about the Mono-winforms-list mailing list