1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-06 09:56:12 +02:00
git/t/lib-gettext.sh
Ævar Arnfjörð Bjarmason d162b25f95 tests: remove support for GIT_TEST_GETTEXT_POISON
This removes the ability to inject "poison" gettext() messages via the
GIT_TEST_GETTEXT_POISON special test setup.

I initially added this as a compile-time option in bb946bba76 (i18n:
add GETTEXT_POISON to simulate unfriendly translator, 2011-02-22), and
most recently modified to be toggleable at runtime in
6cdccfce1e (i18n: make GETTEXT_POISON a runtime option, 2018-11-08)..

The reason for its removal is that the trade-off of maintaining it
v.s. what it's getting us has long since flipped. When gettext was
integrated in 5e9637c629 (i18n: add infrastructure for translating
Git with gettext, 2011-11-18) there was understandable concern on the
Git ML that in marking messages for translation en-masse we'd
inadvertently mark plumbing messages. The GETTEXT_POISON facility was
a way to smoke those out via our test suite.

Nowadays however we're done (or almost entirely done) with any marking
of messages for translation. New messages are usually marked by their
authors, who'll know whether it makes sense to translate them or
not. If not any errors in marking the messages are much more likely to
be spotted in review than in the the initial deluge of i18n patches in
the 2011-2012 era.

So let's just remove this. This leaves the test suite in a state where
we still have a lot of test_i18n, C_LOCALE_OUTPUT
etc. uses. Subsequent commits will remove those too.

The change to t/lib-rebase.sh is a selective revert of the relevant
part of f2d17068fd (i18n: rebase-interactive: mark comments of squash
for translation, 2016-06-17), and the comment in
t/t3406-rebase-message.sh is from c7108bf9ed (i18n: rebase: mark
messages for translation, 2012-07-25).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-01-21 15:50:01 -08:00

64 lines
1.6 KiB
Bash

# Initialization and Icelandic locale for basic git i18n tests,
# which source this scriptlet instead of ./test-lib.sh.
#
# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
#
. ./test-lib.sh
GIT_TEXTDOMAINDIR="$GIT_BUILD_DIR/po/build/locale"
GIT_PO_PATH="$GIT_BUILD_DIR/po"
export GIT_TEXTDOMAINDIR GIT_PO_PATH
if test -n "$GIT_TEST_INSTALLED"
then
. "$(git --exec-path)"/git-sh-i18n
else
. "$GIT_BUILD_DIR"/git-sh-i18n
fi
if test_have_prereq GETTEXT
then
# is_IS.UTF-8 on Solaris and FreeBSD, is_IS.utf8 on Debian
is_IS_locale=$(locale -a 2>/dev/null |
sed -n '/^is_IS\.[uU][tT][fF]-*8$/{
p
q
}')
# is_IS.ISO8859-1 on Solaris and FreeBSD, is_IS.iso88591 on Debian
is_IS_iso_locale=$(locale -a 2>/dev/null |
sed -n '/^is_IS\.[iI][sS][oO]8859-*1$/{
p
q
}')
# Export them as an environment variable so the t0202/test.pl Perl
# test can use it too
export is_IS_locale is_IS_iso_locale
if test -n "$is_IS_locale" &&
test $GIT_INTERNAL_GETTEXT_SH_SCHEME != "fallthrough"
then
# Some of the tests need the reference Icelandic locale
test_set_prereq GETTEXT_LOCALE
# Exporting for t0202/test.pl
GETTEXT_LOCALE=1
export GETTEXT_LOCALE
say "# lib-gettext: Found '$is_IS_locale' as an is_IS UTF-8 locale"
else
say "# lib-gettext: No is_IS UTF-8 locale available"
fi
if test -n "$is_IS_iso_locale" &&
test $GIT_INTERNAL_GETTEXT_SH_SCHEME != "fallthrough"
then
# Some of the tests need the reference Icelandic locale
test_set_prereq GETTEXT_ISO_LOCALE
say "# lib-gettext: Found '$is_IS_iso_locale' as an is_IS ISO-8859-1 locale"
else
say "# lib-gettext: No is_IS ISO-8859-1 locale available"
fi
fi