Re: [PATCH v4 02/73] gettext tests: add GETTEXT_POISON to simulate unfriendly translator

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

 



Hi again,

Ãvar ArnfjÃrà Bjarmason wrote:

> Note that the string we're using ("# GETTEXT POISON #") intentionally
> starts the pound sign.

I think I've caused more grief than it's worth complaining about that.
But here's what a fixup (against 77bc5af, i18n: add GETTEXT_POISON to
simulate unfriendly translator, 2011-02-22) would look like, in case
it's wanted.

If this fixup is applied, the last two paragraphs of the change
description (starting with "Note that the string we're using") could
be removed.

Will comment on how later patches in the series would be affected in
separate messages as I apply them.  Patch 1 (i18n: add no-op _() and
N_() wrappers) and patch 2 (gettext_poison) look good to me, for
what it's worth, with or without this fixup.

-- 8< --
Subject: i18n: make the string used by GETTEXT_POISON less meaningful

The idea of the GETTEXT_POISON facility is to simulate a worst-case
translation, so that strings marked for translation that cause trouble
can be noticed and dealt with.

A string starting with "#" does not seem particularly well suited
for that purpose, since it makes '#' characters that mark a comment
and that translators must be careful not to remove harder to find.
Plus it muddles the issue --- is the poisonous string meant to be a
random worst case or not?

The affected strings with a "# " are in wt-status.c, builtin/commit.c,
and builtin/tag.c.  A proof-of-concept patch moving the # signs
outside the translated strings exists and works well.  If we want to
mark those strings for translation without something like that patch,
we can skip the relevant tests or start returning a string starting
with a hash then.

Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
 gettext.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gettext.h b/gettext.h
index 11d82b0..361962e 100644
--- a/gettext.h
+++ b/gettext.h
@@ -23,7 +23,7 @@
 
 static inline FORMAT_PRESERVING(1) const char *_(const char *msgid)
 {
-	return use_gettext_poison() ? "# GETTEXT POISON #" : msgid;
+	return use_gettext_poison() ? " GETTEXT POISON " : msgid;
 }
 
 /* Mark msgid for translation but do not translate it. */
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]