RememberMessages error

Mar 16, 2011 at 9:00 AM



In my C# program I keep getting these errors from the RuntimeCompiler.cs   Compile() function:

 error CS0103: The name 'RememberMessages' does not exist in the current context 
 error CS0103: The name 'TranslateMessages' does not exist in the current context

Do you have any idea what could be causing this, I already looked at the project settings and made them the same as in the example.

I also included Messages.cs in my project.




Mar 16, 2011 at 9:45 AM

Declaration of messages class

namespace YourProjectNamespace
{ public static class Messages { public static string MyMessage = "My internal, neutral message"; } }

Messages class must be in namespace of your project or You must insert Messages namespace in using header. If any further problems, please give me more information.

Mar 16, 2011 at 9:58 AM

I included NLocalizer in my solution so I could debug it, and found the problem is in function ToCSharpCode().

Here the line is generated: 

            if (translation.Exists("Neutral", "Messages") == false)

 So it must have something to do with "Neutral" 

Mar 16, 2011 at 10:06 AM
Edited Mar 16, 2011 at 10:06 AM

error CS0103: The name 'RememberMessages' does not exist in the current context

that message mean's You have no Messages strings and RememberMessages method didn't created. Please check - do You have any string from Messages class in Dutch.lang file? It's necessary:

(Messages)MyMessage = My example, translated message
Mar 16, 2011 at 10:07 AM

Problem solved !

For some reason lines like:

  (Messages)HelloWorld = Hello world!

Were not in my .lang files.

Mar 16, 2011 at 10:15 AM

Thanks for feedback.

I see - the new, stable version of NLocalizer must have good error detection and must be more friendly.

Mar 16, 2011 at 12:39 PM

Spot on !

And may I suggest automated translation by Google Translate / Microsoft Translate ?

Microsoft Translate (Bing) is better I think as Google Translate can put escape sequences in the translation of strings containing characters as "&"


Mar 16, 2011 at 12:46 PM

I will do this (Microsoft Translator and Google Translator), because it's easy and will be fine feature.

Sep 2, 2011 at 3:28 PM

NLocalizer 1.7+ has implemented automatic Google Translator and don't require Messages class.