[Mono-list] translations.cs from nunit-gtk

George Farris george@gmsys.com
Wed, 07 Jan 2004 12:27:35 -0800


I'm trying to get some I18N stuff to work with C# and have a copy of
translations.cs from nunit-gtk.  I have the following main.cs file:

using System;
using System.IO;
using System.Reflection;
 
namespace mytest {

        public class mt
        {
                static string _ (string key)
                {
                        return ResMan.GetString (key);
                }

                public static void Main (string[] args) 
                {
                        Console.WriteLine(_("This is a test")); 
                        
                }
        }
}

My makefile is as follows:

MCS = mcs
RESOURCES= /resource:./strings.resources,strings.resources \
        /resource:./strings.fr.resources,strings.fr.resources 

SOURCES = main.cs  translation.cs

all: mytest.exe

mytest.exe: $(SOURCES)
        $(MCS) $(RESOURCES) -o $@ $(SOURCES)

clean:
        -rm *.exe 


I have a strings.fr.txt file with:

# main.cs: 16
This_is_a_test = C'est un essai

this has been run through monoresgen.

If I export LANG=fr_FR the translation doesn't work.  Can anyone give me
any pointers here?

If I put a writeline statement in the "_" function it seems to be called
but the translations aren't done.

Thanks
-- 
George Farris <george@gmsys.com>