bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gettext] Problems at run-time retrieval of msgid with '\\n'


From: Felix Schwarz
Subject: [bug-gettext] Problems at run-time retrieval of msgid with '\\n'
Date: Fri, 03 Aug 2012 23:19:41 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0

Hi *,

I'm not sure I'm asking at the right place but any help is welcome.

My problem is a msgid which contains '\\n' (so the user visible string should
be '\n', not a newline). Using the gettext toolchain (xgettext, msgfmt)
everything works until runtime.

I'm running a Python script though I can reproduce the issue with a simple C++
program as well so I thing the problem is really in gettext somewhere.

Here is my sample program:
-----------------------------------------------------------------------
#include <libintl.h>
#include <locale.h>
#include <iostream>
int main (){
    setlocale(LC_ALL, "");
    bindtextdomain("messages", ".");
    textdomain("messages");
    std::cout << gettext("translated...") << std::endl;
    std::cout << gettext("Please use \\n for newlines") << std::endl;
}
-----------------------------------------------------------------------

If I don't have any translations, everything is shown as expected.

The po file has this msgid:
msgid "Please use \\n for newlines"

However regardless of what I put in the po file, at runtime I only see a
translation for the first msgid ("translated...") but not for the second. That
holds true even if my msgstr is something simple as 'foobar'.

- Is this likely to be a bug in gettext?
- Do I miss something here, e.g. gettext limitations?
- Should I file a bug?

Also I would be interested if this is more likely a bug in the mo compile step
or if the run-time msgid lookup fails.

I'm on Fedora Linux 17, using gettext-0.18.1.1-14.fc17.x86_64.

fs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]