Only headaches from this Mono library...
I created simple C# console app from this internationalization tutorial
It works when building it with mono, but I want to build/run it using Visual Studio. I added Mono.Posix
nuget to project.
Program looks like this:
using System;
using Mono.Unix;
using System.Globalization;
using System.Threading;
public class i18n
{
public static void Main(string[] argv)
{
Catalog.Init("lv", "./locale");
Console.WriteLine(Catalog.GetString("My name is {0}"), "Enzo");
int i = 20;
Console.WriteLine(Catalog.GetPluralString("I'm {0} year old.", "I'm {0} years old.", i), i);
i = 21;
Console.WriteLine(Catalog.GetPluralString("I'm {0} year old.", "I'm {0} years old.", i), i);
i = 22;
Console.WriteLine(Catalog.GetPluralString("I'm {0} year old.", "I'm {0} years old.", i), i);
Console.ReadKey();
}
}
First I got error that MonoPosixHelper.dll
could not be found. Added it. Then intl.dll
was missing. Added. Now I get PInvokeStackImbalance occured
message:
Managed Debugging Assistant 'PInvokeStackImbalance' has detected a problem in 'D:\TESTS\i18n\i18n\bin\x86\Debug\i18n.vshost.exe'.
Additional information: A call to PInvoke function 'Mono.Posix!Mono.Unix.Catalog::bindtextdomain' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
It all happens in Catalog.Init("lv", "./locale");
I have no clue what is wrong/missing etc.