msgfmt not able to handle CR??

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
sdp
Knows some wx things
Knows some wx things
Posts: 28
Joined: Wed Oct 05, 2005 6:43 pm

msgfmt not able to handle CR??

Post by sdp » Tue Nov 22, 2005 10:56 pm

I have a resource file in which i keep all my strings used in the application. Some of the strings have \n in them, as I want the strings to be displayed in different lines.

When I use msgfmt to get the .mo file, I get the error saying "invalid control sequence" and the .po doesn't get compiled.

ex:
STRTABLE{
/* FIRST_STRING*/ _("display this is line 1.\n\n\
display this in line2")
}

enum {
FIRST_STRING
}

my code has:
wxStaticTextVar->SetLabel(STRTABLE[FIRST_STRING]);

I am using poedit. I have to convert this to German. I did my own translation for the string. I got the .po file.

But, msgfmt doesn't like the control characters \n\n in the translated string. If I remove those, then everything is fine, but then, the string doesn't show up in 2 lines in the localized German UI as I wanted.


I would appreciate if anyone can suggest how to make this work.

thanks,
shailesh

chris
I live to help wx-kind
I live to help wx-kind
Posts: 150
Joined: Fri Oct 08, 2004 2:05 pm
Location: Europe

Re: msgfmt not able to handle CR??

Post by chris » Wed Nov 23, 2005 11:37 am

Hi,
sdp wrote: STRTABLE{
/* FIRST_STRING*/ _("display this is line 1.\n\n\
display this in line2")
}
Did you try write that in a single line like
STRTABLE{
/* FIRST_STRING*/ _("display this is line 1.\n\ndisplay this in line2")
}
?

Chris
this->signature=NULL;

Dummy
Earned some good credits
Earned some good credits
Posts: 119
Joined: Tue May 10, 2005 10:29 am

Post by Dummy » Wed Nov 23, 2005 11:51 am

Hi,

if you want to write a string in 2 lines - in my opinion - you have to write it in this way:

Code: Select all

_("display this is line 1.\n\n"
  "display this in line2")
Try it :)

Post Reply