[Top][All Lists]

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

Re: gettext 0.15 complains about \v in strings, but argp uses \v

From: Paul Eggert
Subject: Re: gettext 0.15 complains about \v in strings, but argp uses \v
Date: Tue, 08 Aug 2006 09:29:08 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

> Ouch; that is an unfortunate choice of a separator.

I agree.

> The restriction reflects the understanding of the translators and the
> checks done in msgfmt.

OK, thanks for explaining.  How about this patch to the documentation?
It adds that explanation, along with a bit more, to the manual.

2006-08-08  Paul Eggert  <address@hidden>

        * gettext.texi (Preparing Strings): Document problems with control
        characters like \v.

--- gettext-0.15/gettext-tools/doc/gettext.texi 2006-06-30 07:25:39.000000000 
+++ gettext-0.15-backslash-v/gettext-tools/doc/gettext.texi     2006-08-08 
09:25:19.000000000 -0700
@@ -1629,6 +1629,9 @@ Entire sentences.
 Split at paragraphs.
+Avoid control characters.
 Use format strings instead of string concatenation.
 @end itemize
@@ -1749,6 +1752,35 @@ such as the input options, the output op
 output options.  This will help every user to find the option he is
 looking for.
address@hidden control characters
+Most languages have special escape sequences for control characters
+and the like; for example, the C string literal @samp{"\v"} denotes a
+string that contains a vertical tab character.  The horizontal tab
address@hidden and newline @samp{\n} escape sequences are universally
+understood, but lesser-used escape sequences like @samp{\v} can cause
+problems for translators.  Some might put the @samp{\v} literally in
+the translation, while others will know that it means a vertical tab
+and replace it with one or more blank lines; others might not even
+notice it.
+If your program needs to generate an unusual character via an escape
+sequence, it is better to output it directly, without using
+translation.  For example, instead of this:
+printf (gettext ("Subtotal: %d"), subtotal);
+printf (gettext ("\vTotal: %d"), subtotal);
address@hidden example
+you can use this:
+printf (gettext ("Subtotal: %d"), subtotal);
+printf ("\v");
+printf (gettext ("Total: %d"), subtotal);
address@hidden example
 @cindex string concatenation
 @cindex concatenation of strings
 Hardcoded string concatenation is sometimes used to construct English

reply via email to

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