bug-gettext
[Top][All Lists]
Advanced

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

[bug-gettext] Raw C++ strings...


From: Victor Khimenko
Subject: [bug-gettext] Raw C++ strings...
Date: Sat, 24 Dec 2011 22:57:19 +0400

Is it possible to somehow teach xgettext to accept multiline strings? It looks like a good way to handle long messages in C++, but I can not understand how to teach gettext to accept them.

Here is simple example:

$ cat test.C
constexpr const char *N_(const char *s) { return s; }

const char *help_string = N_(R"END(Here is long, long
multiline help text.)END");

GCC accepts is just fine:
$ gcc -std=c++0x -S test.C -o-
.file "test.C"
.globl help_string
.section .rodata
.align 8
.LC0:
.string "Here is long, long\nmultiline help text."
.data
.align 8
.type help_string, @object
.size help_string, 8
help_string:
.quad .LC0
.ident "GCC: (GNU) 4.6.2"
.section .note.GNU-stack,"",@progbits

But gettext loses part of the text:
$ xgettext -kN_ test.C -o-
test.C:3: warning: unterminated string literal
test.C:4: warning: unterminated string literal
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <address@hidden>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-12-24 22:55+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <address@hidden>\n"
"Language-Team: LANGUAGE <address@hidden>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"

#: test.C:3
msgid "END(Here is long, long"
msgstr ""

Perhaps I need to specify some option?


reply via email to

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