gettextize: git-notes "Refusing to %s notes in %s" message
The first %s in "Refusing to %s notes in %s" is one of "git notes
ACTION". So we need to mark those actions for translation and later
use _().
Also add a TRANSLATORS comment explaining to translators what the
first %s means.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
The first %s in "Refusing to %s notes in %s" is one of "git notes
ACTION". So we need to mark those actions for translation and later
use _().
Also add a TRANSLATORS comment explaining to translators what the
first %s means.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-notes GIT_NOTES_REWRITE_MODE error message
Use sprintf format for the error message that's displayed if
GIT_NOTES_REWRITE_MODE is invalid, and leave a note in a TRANSLATORS
comment indicating what the message means.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Use sprintf format for the error message that's displayed if
GIT_NOTES_REWRITE_MODE is invalid, and leave a note in a TRANSLATORS
comment indicating what the message means.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-notes basic commands
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-gc "Auto packing the repository" message
Split up the "Auto packing the repository" message into quiet and
verbose variants to make translation easier.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Split up the "Auto packing the repository" message into quiet and
verbose variants to make translation easier.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-gc basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-describe basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-clean clean.requireForce messages
Split up the "clean.requireForce set/defaults to true..." die()
message to make it easier to translate.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Split up the "clean.requireForce set/defaults to true..." die()
message to make it easier to translate.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-clean basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-bundle basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-archive basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-status "renamed: " message
Gettextize the "renamed: %s -> %s" message which appears as part of
git-status(1) output. Two tests in t4001-diff-rename.sh explicitly
checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "renamed: %s -> %s" message which appears as part of
git-status(1) output. Two tests in t4001-diff-rename.sh explicitly
checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-status "Initial commit" message
Gettextize the "# Initial commit" message. A test in t7501-commit.sh
explicitly checked for this message. Change it to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "# Initial commit" message. A test in t7501-commit.sh
explicitly checked for this message. Change it to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-status "Changes to be committed" message
Gettextize the "# Changes to be committed:" messages. Several tests
explicitly checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.
Since these tests didn't check for the rest of the git-status(1)
output this change has been split up from the "git-status basic
messages" patch.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "# Changes to be committed:" messages. Several tests
explicitly checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.
Since these tests didn't check for the rest of the git-status(1)
output this change has been split up from the "git-status basic
messages" patch.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-status shortstatus messages
Make the messages added in v1.7.2-rc0~54^2~1 translatable. Some of
these could use the to be implemented plural support in the gettext
library.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Make the messages added in v1.7.2-rc0~54^2~1 translatable. Some of
these could use the to be implemented plural support in the gettext
library.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-status "nothing to commit" messages
Gettextize the "nothing to commit" messages. Many tests explicitly
checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "nothing to commit" messages. Many tests explicitly
checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-status basic messages
Gettextize the most common git-status messages. Many tests checked for
these explicitly. Change them to skip under GETTEXT_POISON=YesPlease.
Some of the tests in t7508-status.sh needed to be split up when I
added NO_GETTEXT_POISON to them, since parts of them affected later
tests (some of which aren't being skipped) indirectly.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the most common git-status messages. Many tests checked for
these explicitly. Change them to skip under GETTEXT_POISON=YesPlease.
Some of the tests in t7508-status.sh needed to be split up when I
added NO_GETTEXT_POISON to them, since parts of them affected later
tests (some of which aren't being skipped) indirectly.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-push "prevent you from losing" message
Gettextize the "To prevent you from losing history" message. A test in
lib-httpd.sh and another in t5541-http-push.sh explicitly checked for
this message. Change them to skip under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "To prevent you from losing history" message. A test in
lib-httpd.sh and another in t5541-http-push.sh explicitly checked for
this message. Change them to skip under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-push basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-tag tag_template message
Mark the tag_template message as translatable with N_() and then use
it later with _(). We need to skip a test under GETTEXT_POISON that
relies on the output having a leading newline.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Mark the tag_template message as translatable with N_() and then use
it later with _(). We need to skip a test under GETTEXT_POISON that
relies on the output having a leading newline.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-tag basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-reset "Unstaged changes after reset" message
Gettextize the ""Unstaged changes after reset:" message. A test in
t7102-reset.sh explicitly checked for this message. Change it to skip
under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the ""Unstaged changes after reset:" message. A test in
t7102-reset.sh explicitly checked for this message. Change it to skip
under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-reset reset_type_names messages
Make the messages in git-reset that use the reset_type_names static
array to be translatable by marking the array items with N_() and
using _() later.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Make the messages in git-reset that use the reset_type_names static
array to be translatable by marking the array items with N_() and
using _() later.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-reset basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-rm basic messages
Make the basic git-mv messages translatable, but skip things like "rm
'%s'\n" and "git rm '%s'\n" for now.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Make the basic git-mv messages translatable, but skip things like "rm
'%s'\n" and "git rm '%s'\n" for now.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-mv "bad" messages
Gettextize messages made by assigning to the "bad" char* variable.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize messages made by assigning to the "bad" char* variable.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-mv basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-merge "Wonderful" message
Gettextize the "Wonderful" message. A test in t7600-merge.sh
explicitly checked for this message. Change it to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "Wonderful" message. A test in t7600-merge.sh
explicitly checked for this message. Change it to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-merge "You have not concluded your merge" messages
Gettextize the "You have not concluded your merge messages. A test in
t3030-merge-recursive.sh explicitly checked for this message. Change
it to skip the test under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "You have not concluded your merge messages. A test in
t3030-merge-recursive.sh explicitly checked for this message. Change
it to skip the test under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-merge "Updating %s..%s" message
Gettextize the "Updating %s..%s\n" message. A test in
t1200-tutorial.sh explicitly checked for this message. Split it into
two tests to skip the test_cmp test under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "Updating %s..%s\n" message. A test in
t1200-tutorial.sh explicitly checked for this message. Split it into
two tests to skip the test_cmp test under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-merge basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-log "--OPT does not make sense" messages
Gettextize the "--name-only/--name-status/--check does not make sense"
messages. A test in t4014-format-patch.sh explicitly checked for these
messages. Change them to skip under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "--name-only/--name-status/--check does not make sense"
messages. A test in t4014-format-patch.sh explicitly checked for these
messages. Change them to skip under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-log basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-grep "--open-files-in-pager" message
Gettextize the "--open-files-in-pager only works on the worktree"
message. A test in t7811-grep-open.sh explicitly checked for this
message. Change it to skip under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "--open-files-in-pager only works on the worktree"
message. A test in t7811-grep-open.sh explicitly checked for this
message. Change it to skip under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-grep basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-fetch split up "(non-fast-forward)" message
Split up the "(non-fast-forward)" message from printf directives and
make it translatable.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Split up the "(non-fast-forward)" message from printf directives and
make it translatable.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-fetch update_local_ref messages
Translate a "[rejected]" message spotted by Jeff King, and other
things in update_local_ref along with it.
Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Translate a "[rejected]" message spotted by Jeff King, and other
things in update_local_ref along with it.
Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-fetch formatting messages
Translate some of the formatting messages that appear on git-fetch
showing how branches/tags etc. were updated.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Translate some of the formatting messages that appear on git-fetch
showing how branches/tags etc. were updated.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-fetch basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-diff basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-commit advice messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-commit "enter the commit message" message
Gettextize the "# Please enter the commit message for your changes."
message. Several tests in t7500-commit.sh and t7502-commit.sh assume
that this message starts with a newline. Change the tests to to skip
under GETTEXT_POISON=YesPlease.
These fail under GETTEXT_POISON=YesPlease because the poison editor
message doesn't do the right thing with comments and line breaks, so
these messages will be incorrectly broken up across lines.
This test should not be skipped under a hypothetical future testing
mode that tests Git under language locales, since those messages
should all start with a newline like the original.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "# Please enter the commit message for your changes."
message. Several tests in t7500-commit.sh and t7502-commit.sh assume
that this message starts with a newline. Change the tests to to skip
under GETTEXT_POISON=YesPlease.
These fail under GETTEXT_POISON=YesPlease because the poison editor
message doesn't do the right thing with comments and line breaks, so
these messages will be incorrectly broken up across lines.
This test should not be skipped under a hypothetical future testing
mode that tests Git under language locales, since those messages
should all start with a newline like the original.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-commit print_summary messages
Gettextize the "(root-commit)" and "detached HEAD" fragments that
appear when you commit either the root commit, or a commit in a
detached head translatable.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "(root-commit)" and "detached HEAD" fragments that
appear when you commit either the root commit, or a commit in a
detached head translatable.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-commit formatting messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-commit "middle of a merge" message
Gettextize the "You are in the middle of a merge -- cannot amend."
message. Several tests in t7110-reset-merge.sh explicitly checked for
this message. Change them to skip under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "You are in the middle of a merge -- cannot amend."
message. Several tests in t7110-reset-merge.sh explicitly checked for
this message. Change them to skip under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-commit basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-checkout "Switched to a .. branch" message
Split up the "Switched to and reset branch" and "Switched to a new
branch" messages to make them easier to translate.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Split up the "Switched to and reset branch" and "Switched to a new
branch" messages to make them easier to translate.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-checkout "HEAD is now at" message
Gettextize the "HEAD is now at" messages. Several tests in t7201-co.sh
explicitly checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "HEAD is now at" messages. Several tests in t7201-co.sh
explicitly checked for this message. Change them to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-checkout describe_detached_head messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-checkout: our/their version message
Split up the "does not have our/their version" message to make it
easier to translate.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Split up the "does not have our/their version" message to make it
easier to translate.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-checkout basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-branch "(no branch)" message
Gettextize the "(no branch)" message that's shown by "git branch" when
you're in a detached HEAD.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "(no branch)" message that's shown by "git branch" when
you're in a detached HEAD.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-branch "git branch -v" messages
Make the "git branch -v" messages translatable, e.g.:
5054b57 [ahead 8] branch error fixup
This is possibly a plumbing message.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Make the "git branch -v" messages translatable, e.g.:
5054b57 [ahead 8] branch error fixup
This is possibly a plumbing message.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-branch "Deleted branch [...]" message
Gettextize the "Deleted %sbranch %s (was %s).\n" messages. test in
t3200-branch.sh explicitly checked for this message. Change it to skip
under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "Deleted %sbranch %s (was %s).\n" messages. test in
t3200-branch.sh explicitly checked for this message. Change it to skip
under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-branch "remote branch '%s' not found" message
This could be done better by splitting it up, but it would change too
much code, which I'm trying to avoid at this point. Instead add a
TRANSLATORS comment to explain what "remote " does.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
This could be done better by splitting it up, but it would change too
much code, which I'm trying to avoid at this point. Instead add a
TRANSLATORS comment to explain what "remote " does.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-branch basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-add refresh_index message
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-add "remove '%s'" message
Gettextize the "remove '%s'\n" message. A test in t2200-add-update.sh
explicitly checked for this message. Change it to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "remove '%s'\n" message. A test in t2200-add-update.sh
explicitly checked for this message. Change it to skip under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-add "pathspec [...] did not match" message
Gettextize the "pathspec '%s' did not match any files" message. A test
in t3700-add.sh explicitly checked for this message. Change it to skip
under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "pathspec '%s' did not match any files" message. A test
in t3700-add.sh explicitly checked for this message. Change it to skip
under GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-add "Use -f if you really want" message
Gettextize the "Use -f if you really want to add them.\n"
message. Tests in t2204-add-ignored.sh and t3700-add.sh explicitly
checked for this message. Split the tests that did so up and skip
portion that calls grep on this message under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Gettextize the "Use -f if you really want to add them.\n"
message. Tests in t2204-add-ignored.sh and t3700-add.sh explicitly
checked for this message. Split the tests that did so up and skip
portion that calls grep on this message under
GETTEXT_POISON=YesPlease.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-add "no files added" message
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-add basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-clone "Cloning into" message
Split up the "Cloning into %s" and "Cloning into bare repository %s"
messages to make them easier to translate.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Split up the "Cloning into %s" and "Cloning into bare repository %s"
messages to make them easier to translate.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-clone basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext tests: test message re-encoding under C
Add tests for message re-encoding under C. Unlike the Shell tests
these tests will break under GNU libintl if the recent patch to
gettext.c is reverted. So this serves as a regression test for that
issue.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Add tests for message re-encoding under C. Unlike the Shell tests
these tests will break under GNU libintl if the recent patch to
gettext.c is reverted. So this serves as a regression test for that
issue.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
po/is.po: add Icelandic translation
Translate some non-TEST into Icelandic. This is far from a complete
translation, I've only translated init-db.c.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Translate some non-TEST into Icelandic. This is far from a complete
translation, I've only translated init-db.c.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext tests: mark a test message as not needing translation
This was the only message in t/t0200/* that didn't have a TRANSLATORS
comment, without it translators will waste time translating this
needlessly.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
This was the only message in t/t0200/* that didn't have a TRANSLATORS
comment, without it translators will waste time translating this
needlessly.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext tests: test re-encoding with a UTF-8 msgid under Shell
A test that tests that calling gettext on a UTF-8 msgid works, and
that recoding the resulting string works too.
This test uses the --from-code=UTF-8 xgettext(1) argument introduced
in an earlier patch.
This patch only tests the shellscript portion of our gettext
interface. I can't get any of these tests to fail on any of the
gettext implementations I have around, even without the previous patch
to gettext.c. But having exhaustive tests in this area is good
regardless.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
A test that tests that calling gettext on a UTF-8 msgid works, and
that recoding the resulting string works too.
This test uses the --from-code=UTF-8 xgettext(1) argument introduced
in an earlier patch.
This patch only tests the shellscript portion of our gettext
interface. I can't get any of these tests to fail on any of the
gettext implementations I have around, even without the previous patch
to gettext.c. But having exhaustive tests in this area is good
regardless.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext tests: test message re-encoding under Shell
Our PO files are written in UTF-8, but We're not using
setlocale(LC_CTYPE, "") so it's not a given that someone with e.g. a
ISO-8859-1 locale will get messages in ISO-8859-1, and not UTF-8.
Introduce a new test to test for this, it uses the recently added
GETTEXT_ISO_LOCALE prerequisite.
This patch only tests the shellscript portion of our gettext
interface. I can't get any of these tests to fail on any of the
gettext implementations I have around, even without the previous patch
to gettext.c. But having exhaustive tests in this area is good
regardless.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Our PO files are written in UTF-8, but We're not using
setlocale(LC_CTYPE, "") so it's not a given that someone with e.g. a
ISO-8859-1 locale will get messages in ISO-8859-1, and not UTF-8.
Introduce a new test to test for this, it uses the recently added
GETTEXT_ISO_LOCALE prerequisite.
This patch only tests the shellscript portion of our gettext
interface. I can't get any of these tests to fail on any of the
gettext implementations I have around, even without the previous patch
to gettext.c. But having exhaustive tests in this area is good
regardless.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext tests: add detection for is_IS.ISO-8859-1 locale
Add a GETTEXT_ISO_LOCALE prerequisite to lib-gettext.sh, it'll be set
if we have an is_IS.ISO-8859-1 locale.
This is needed for an upcoming test that checks if our gettext library
can recode our UTF-8 po/is.po to is_IS.ISO-8859-1 on request.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Add a GETTEXT_ISO_LOCALE prerequisite to lib-gettext.sh, it'll be set
if we have an is_IS.ISO-8859-1 locale.
This is needed for an upcoming test that checks if our gettext library
can recode our UTF-8 po/is.po to is_IS.ISO-8859-1 on request.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext tests: test if $VERSION exists before using it
Versions of Locale::Messages before 1.17 didn't have a $VERSION
variable. This caused test failures on boxes that had this old version
installed, since the warnings pragma emits warnings on STDERR, which
fails the test.
Change the test to work around this by first checking if the $VERSION
variable is defined before using it.
Reported-by: Jens Lehmann <Jens.Lehmann@web.de>
Tested-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Versions of Locale::Messages before 1.17 didn't have a $VERSION
variable. This caused test failures on boxes that had this old version
installed, since the warnings pragma emits warnings on STDERR, which
fails the test.
Change the test to work around this by first checking if the $VERSION
variable is defined before using it.
Reported-by: Jens Lehmann <Jens.Lehmann@web.de>
Tested-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-init "Initialized [...] repository" message
Change the git-init "Initialized empty Git repository" message and its
variants to use gettext.
This is one of the messages that could do with splitting up, I had a
WIP patch to do that that began like this:
const char *reinit_shared = _("Reinitialized existing shared Git repository in %s\n");
const char *init_shared = _("Initialized empty shared Git repository in %s\n");
const char *reinit_noshared = _("Reinitialized existing Git repository in %s\n");
const char *init_noshared = _("Initialized empty Git repository in %s\n");
But in the first round of gettextization I'm aiming to keep code
changes to a minimum for ease of review.
We can solicit input from translators about which messages that use
too much sprintf-ing are troublesome, and change those later.
Note that the TRANSLATORS comment doesn't use the usual Git
style. This is because everything from "/* TRANSLATORS: " to "*/" will
extracted as-is xgettext(1) and presented to translators, including
newlines and leading "*"'s. There seems to be no way to change that,
short of patching xgettext itself.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Change the git-init "Initialized empty Git repository" message and its
variants to use gettext.
This is one of the messages that could do with splitting up, I had a
WIP patch to do that that began like this:
const char *reinit_shared = _("Reinitialized existing shared Git repository in %s\n");
const char *init_shared = _("Initialized empty shared Git repository in %s\n");
const char *reinit_noshared = _("Reinitialized existing Git repository in %s\n");
const char *init_noshared = _("Initialized empty Git repository in %s\n");
But in the first round of gettextization I'm aiming to keep code
changes to a minimum for ease of review.
We can solicit input from translators about which messages that use
too much sprintf-ing are troublesome, and change those later.
Note that the TRANSLATORS comment doesn't use the usual Git
style. This is because everything from "/* TRANSLATORS: " to "*/" will
extracted as-is xgettext(1) and presented to translators, including
newlines and leading "*"'s. There seems to be no way to change that,
short of patching xgettext itself.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettextize: git-init basic messages
Change the user visible strings in init-db.c to use gettext
localizations. This only converts messages which needed to be changed
from "foo" to _("foo"), and didn't need any TRANSLATORS comments.
I haven't marked the messages in init_db_usage or init_db_options for
translation, since that would require additional changes in
parse-options.c. Those can be done later.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Change the user visible strings in init-db.c to use gettext
localizations. This only converts messages which needed to be changed
from "foo" to _("foo"), and didn't need any TRANSLATORS comments.
I haven't marked the messages in init_db_usage or init_db_options for
translation, since that would require additional changes in
parse-options.c. Those can be done later.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext tests: skip lib-gettext.sh tests under GETTEXT_POISON
Change the gettext tests (all of whom use lib-gettext.sh) to skip
under GETTEXT_POISON=YesPlease. We also print a message to this
effect.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Change the gettext tests (all of whom use lib-gettext.sh) to skip
under GETTEXT_POISON=YesPlease. We also print a message to this
effect.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext tests: add GETTEXT_POISON=YesPlease Makefile parameter
Add a new GETTEXT_POISON=YesPlease Makefile debug target. With this
target every invocation of _(s) will return "# GETTEXT POISON #"
instead of `s' or the msgstr that `s` would look up.
This target is intended to sanity check the gettextization series
against the test suite.
If the test suite is relying on the US English output of Git the test
should either have a NO_GETTEXT_POISON prerequisite, or the message in
question shouldn't be translated because it's a plumbing message.
We won't catch everything with this since we don't have 100% test
coverage, but the chances of us doing so are much larger.
The reason I'm using "# GETTEXT POISON #" is that a lot of tests that
rely on the fake editor would break if it wasn't a comment, since the
comment message that's inserted on e.g. `git commit --amend' is
translatable.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Add a new GETTEXT_POISON=YesPlease Makefile debug target. With this
target every invocation of _(s) will return "# GETTEXT POISON #"
instead of `s' or the msgstr that `s` would look up.
This target is intended to sanity check the gettextization series
against the test suite.
If the test suite is relying on the US English output of Git the test
should either have a NO_GETTEXT_POISON prerequisite, or the message in
question shouldn't be translated because it's a plumbing message.
We won't catch everything with this since we don't have 100% test
coverage, but the chances of us doing so are much larger.
The reason I'm using "# GETTEXT POISON #" is that a lot of tests that
rely on the fake editor would break if it wasn't a comment, since the
comment message that's inserted on e.g. `git commit --amend' is
translatable.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext.c: use libcharset.h instead of langinfo.h when available
Change the git_setup_gettext function to use libcharset to query the
character set of the current locale if it's available. I.e. use it
instead of nl_langinfo if HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
The locale_charset function returns a `const char*', instead of
`char*` as nl_langinfo does. Change the declaration of the variable
we're using to store the `charset' in `git_setup_gettext' accordingly.
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Change the git_setup_gettext function to use libcharset to query the
character set of the current locale if it's available. I.e. use it
instead of nl_langinfo if HAVE_LIBCHARSET_H is set.
The GNU gettext manual recommends using langinfo.h's
nl_langinfo(CODESET) to acquire the current character set, but on
systems that have libcharset.h's locale_charset() using the latter is
either saner, or the only option on those systems.
GNU and Solaris have a nl_langinfo(CODESET), FreeBSD can use either,
but MinGW and some others need to use libcharset.h's locale_charset()
instead.
The locale_charset function returns a `const char*', instead of
`char*` as nl_langinfo does. Change the declaration of the variable
we're using to store the `charset' in `git_setup_gettext' accordingly.
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext.c: work around us not using setlocale(LC_CTYPE, "")
Change the gettext setup code to arrange for messages to be emitted in
the user's requested encoding, but avoid setting LC_CTYPE from the
environment for the whole program.
In 107880a I removed our use of setlocale(LC_CTYPE, "") because of a
bug in vsnprintf in the GNU C Library [1].
Even if it wasn't for that bug we wouldn't want to use LC_CTYPE at
this point, because it'd require auditing all the code that uses C
functions whose semantics are modified by LC_CTYPE.
But only setting LC_MESSAGES as we do creates a problem, since we
declare the encoding of our PO files[2] the gettext implementation
will try to recode it to the user's locale, but without LC_CTYPE it'll
emit something like this on 'git init'
Bj? til t?ma Git lind ? /hl/agh/.git/
Gettext knows about the encoding of our PO file, but we haven't told
it about the user's encoding, so all the non-US-ASCII characters get
encoded to question marks.
But we're in luck! We can set LC_CTYPE from the environment only while
we call nl_langinfo and bind_textdomain_codeset. That suffices to tell
gettext what encoding it should emit in, so it'll now say:
Bjó til tóma Git lind í /hl/agh/.git/
And the equivalent ISO-8859-1 string will be emitted under a
ISO-8859-1 locale.
With this change way we get the advantages of setting LC_CTYPE (talk
to the user in his language/encoding), without the major drawbacks
(changed semantics for C functions we rely on).
However foreign functions using other message catalogs that aren't
using our neat trick will still have a problem, e.g. if we have to
call perror(3):
#include <stdio.h>
#include <locale.h>
#include <errno.h>
int main(void)
{
setlocale(LC_MESSAGES, "");
setlocale(LC_CTYPE, "C");
errno = ENODEV;
perror("test");
return 0;
}
Running that will give you a message with question marks:
$ LANGUAGE= LANG=de_DE.utf8 ./test
test: Kein passendes Ger?t gefunden
In the long term we should probably see about getting that vsnprintf
bug in glibc fixed, and audit our code so it won't fall apart under a
non-C locale.
Then we could simply set LC_CTYPE from the environment, which would
make things like the external perror(3) messages work.
1. http://sourceware.org/bugzilla/show_bug.cgi?id=6530
2. E.g. "Content-Type: text/plain; charset=UTF-8\n" in po/is.po
Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Change the gettext setup code to arrange for messages to be emitted in
the user's requested encoding, but avoid setting LC_CTYPE from the
environment for the whole program.
In 107880a I removed our use of setlocale(LC_CTYPE, "") because of a
bug in vsnprintf in the GNU C Library [1].
Even if it wasn't for that bug we wouldn't want to use LC_CTYPE at
this point, because it'd require auditing all the code that uses C
functions whose semantics are modified by LC_CTYPE.
But only setting LC_MESSAGES as we do creates a problem, since we
declare the encoding of our PO files[2] the gettext implementation
will try to recode it to the user's locale, but without LC_CTYPE it'll
emit something like this on 'git init'
Bj? til t?ma Git lind ? /hl/agh/.git/
Gettext knows about the encoding of our PO file, but we haven't told
it about the user's encoding, so all the non-US-ASCII characters get
encoded to question marks.
But we're in luck! We can set LC_CTYPE from the environment only while
we call nl_langinfo and bind_textdomain_codeset. That suffices to tell
gettext what encoding it should emit in, so it'll now say:
Bjó til tóma Git lind í /hl/agh/.git/
And the equivalent ISO-8859-1 string will be emitted under a
ISO-8859-1 locale.
With this change way we get the advantages of setting LC_CTYPE (talk
to the user in his language/encoding), without the major drawbacks
(changed semantics for C functions we rely on).
However foreign functions using other message catalogs that aren't
using our neat trick will still have a problem, e.g. if we have to
call perror(3):
#include <stdio.h>
#include <locale.h>
#include <errno.h>
int main(void)
{
setlocale(LC_MESSAGES, "");
setlocale(LC_CTYPE, "C");
errno = ENODEV;
perror("test");
return 0;
}
Running that will give you a message with question marks:
$ LANGUAGE= LANG=de_DE.utf8 ./test
test: Kein passendes Ger?t gefunden
In the long term we should probably see about getting that vsnprintf
bug in glibc fixed, and audit our code so it won't fall apart under a
non-C locale.
Then we could simply set LC_CTYPE from the environment, which would
make things like the external perror(3) messages work.
1. http://sourceware.org/bugzilla/show_bug.cgi?id=6530
2. E.g. "Content-Type: text/plain; charset=UTF-8\n" in po/is.po
Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
builtin.h: Include gettext.h
Change builtin.h to include gettext.h. This is needed in order to
translate Git's builtin commands (like git-init), which don't include
gettext.h otherwise.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Change builtin.h to include gettext.h. This is needed in order to
translate Git's builtin commands (like git-init), which don't include
gettext.h otherwise.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Makefile: use variables and shorter lines for xgettext
Change the xgettext(1) invocations to use variables for the
C/Shell/Perl files and their options. This makes it easy for users to
override invidivial options from the command-line.
Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Change the xgettext(1) invocations to use variables for the
C/Shell/Perl files and their options. This makes it easy for users to
override invidivial options from the command-line.
Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Makefile: tell xgettext(1) that our source is in UTF-8
By default xgettext(1) assumes that source code is in US-ASCII, change
that to UTF-8 for our case.
I'm not planning to include non-ASCII in any of the main Git interface
strings. But this'll be used for a gettext regression test to make
sure this works if we ever want to go this route, and to check that
the gettext implementation is sane in this regard.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
By default xgettext(1) assumes that source code is in US-ASCII, change
that to UTF-8 for our case.
I'm not planning to include non-ASCII in any of the main Git interface
strings. But this'll be used for a gettext regression test to make
sure this works if we ever want to go this route, and to check that
the gettext implementation is sane in this regard.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Makefile: provide a --msgid-bugs-address to xgettext(1)
Change the invocations of xgettext to use the --msgid-bugs-address
option. This has the effect of adding a Report-Msgid-Bugs-To header to
the git.pot and the derived *.po files. Doing so is recommended by the
gettext manual.
If this isn't added the Report-Msgid-Bugs-To header already in
po/is.po and other PO files will be removed by msgmerge(1).
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Change the invocations of xgettext to use the --msgid-bugs-address
option. This has the effect of adding a Report-Msgid-Bugs-To header to
the git.pot and the derived *.po files. Doing so is recommended by the
gettext manual.
If this isn't added the Report-Msgid-Bugs-To header already in
po/is.po and other PO files will be removed by msgmerge(1).
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Makefile: A variable for options used by xgettext(1) calls
Change the Makefile code to use a variable for the options that all
the xgettext(1) invocations are using. This makes it more readable,
and makes it easier to add more standard options.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Change the Makefile code to use a variable for the options that all
the xgettext(1) invocations are using. This makes it more readable,
and makes it easier to add more standard options.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext tests: locate i18n lib&data correctly under --valgrind
The new t020[01] for gettext support did not find git-sh-i18n and the
translation data when run under --valgrind: lib-gettext.sh tried to
locate them under $GIT_EXEC_PATH, which normally is the git build
directory, but is changed by --valgrind to point to the wrappers.
Introduce a new variable $GIT_BUILD_DIR which can be used to locate
data that resides under the build directory, and use that instead.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
The new t020[01] for gettext support did not find git-sh-i18n and the
translation data when run under --valgrind: lib-gettext.sh tried to
locate them under $GIT_EXEC_PATH, which normally is the git build
directory, but is changed by --valgrind to point to the wrappers.
Introduce a new variable $GIT_BUILD_DIR which can be used to locate
data that resides under the build directory, and use that instead.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
gettext: setlocale(LC_CTYPE, "") breaks Git's C function assumptions
Remove the setlocale/LC_CTYPE call from gettext.c, we only need
setlocale/LC_MESSAGES to use the message catalog, and setting LC_CTYPE
from the environment breaks Git's assumptions about C library
functions.
Under a non-C locale functions like vsnprintf become locale sensitive,
so that they'll e.g. refuse to process ISO-8895-1 data under a UTF-8
locale.
This triggered a "your vsnprintf is broken" error on Git's own
repository when inspecting v0.99.6~1 under a UTF-8 locale.
That commit contains a ISO-8859-1 encoded author name, which the
locale aware vsnprintf(3) won't interpolate in the format argument,
due to mismatch between the data encoding and the locale.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Remove the setlocale/LC_CTYPE call from gettext.c, we only need
setlocale/LC_MESSAGES to use the message catalog, and setting LC_CTYPE
from the environment breaks Git's assumptions about C library
functions.
Under a non-C locale functions like vsnprintf become locale sensitive,
so that they'll e.g. refuse to process ISO-8895-1 data under a UTF-8
locale.
This triggered a "your vsnprintf is broken" error on Git's own
repository when inspecting v0.99.6~1 under a UTF-8 locale.
That commit contains a ISO-8859-1 encoded author name, which the
locale aware vsnprintf(3) won't interpolate in the format argument,
due to mismatch between the data encoding and the locale.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gettext tests: rename test to work around GNU gettext bug
Rename t0200-gettext.sh to t0200-gettext-basic.sh. Versions of GNU
gettext before v0.15 (released in 2006) fail to run the test because
of an old bug in gettext.sh.
To conform with the FHS gettext.sh prints a help message when it's
invoked directly. To do this it checks if $0 is "gettext.sh". This
check was broken before v0.15, it was checking for *\gettext.sh (to
support Windows), but now correctly checks for *\\gettext.sh.
t0200-gettext.sh matched the former broken check, so on systems with
an old GNU gettext (like RHEL 5.4) the test simply printed:
./t0200-gettext.sh
GNU gettext shell script function library version 0.14.6
Usage: . gettext.sh
FATAL: Unexpected exit with code 1
Which is just the gettext.sh help output:
$ gettext.sh
GNU gettext shell script function library version 0.17
Usage: . gettext.sh
Change the test name to t0200-gettext-basic.sh to work around that.
Reported-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Tested-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Rename t0200-gettext.sh to t0200-gettext-basic.sh. Versions of GNU
gettext before v0.15 (released in 2006) fail to run the test because
of an old bug in gettext.sh.
To conform with the FHS gettext.sh prints a help message when it's
invoked directly. To do this it checks if $0 is "gettext.sh". This
check was broken before v0.15, it was checking for *\gettext.sh (to
support Windows), but now correctly checks for *\\gettext.sh.
t0200-gettext.sh matched the former broken check, so on systems with
an old GNU gettext (like RHEL 5.4) the test simply printed:
./t0200-gettext.sh
GNU gettext shell script function library version 0.14.6
Usage: . gettext.sh
FATAL: Unexpected exit with code 1
Which is just the gettext.sh help output:
$ gettext.sh
GNU gettext shell script function library version 0.17
Usage: . gettext.sh
Change the test name to t0200-gettext-basic.sh to work around that.
Reported-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Tested-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gettext: add infrastructure for translating Git with gettext
All of the interface messages in Git core are currently hardcoded in
English. Change that by optionally enabling translation of the core C,
Shell and Perl programs via GNU or Solaris gettext. If you set the
appropriate LC_* variables Git will speak your language, provided that
someone has submitted a translation.
If gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, then Git fall back on its previous behavior of
only speaking English. When using ./configure the autoconf script will
auto-detect if the gettext libraries are installed and act
appropriately.
With NO_GETTEXT=YesPlease gettext support will be #defined away for C
programs. For Shell and Perl programs we rely on the git message
catalog not being available. That's a reasonable assumption since then
the message catalog won't be installed on the system during make
install.
The gettext wrappers that are provided in the patch are only the bare
minimum required to begin translation work. In particular I haven't
added wrappers for the gettext functions that enable plural support,
or those that provide message context (msgctxt).
Those can be added later. The intent is to start with a small subset
and see what we need later, not to start with something that's
unnecessarily large right away.
Implementation and usage notes:
* General:
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git
itself.
* Perl:
Perl code that wants to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by
default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com>
for a further elaboration on this topic.
* Shell:
Shell code that's to be localized should use the new git-sh-i18n
library. It's just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
I originally tried to detect if the system supported `echo -n' but
I found this to be a waste of time. My benchmarks on Linux, Solaris
and FreeBSD reveal that printf(1) is fast enough, especially since
we aren't calling gettext() from within any tight loops, and
unlikely to ever do so.
Solaris has its own non-GNU gettext implementation which this patch
supports, although that may change in the future if it turns out that
we need some GNU libintl features that SunOS doesn't provide.
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Peter Krefting, Junio C Hamano, Thomas Rast and others.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
All of the interface messages in Git core are currently hardcoded in
English. Change that by optionally enabling translation of the core C,
Shell and Perl programs via GNU or Solaris gettext. If you set the
appropriate LC_* variables Git will speak your language, provided that
someone has submitted a translation.
If gettext isn't available, or if Git is compiled with
NO_GETTEXT=YesPlease, then Git fall back on its previous behavior of
only speaking English. When using ./configure the autoconf script will
auto-detect if the gettext libraries are installed and act
appropriately.
With NO_GETTEXT=YesPlease gettext support will be #defined away for C
programs. For Shell and Perl programs we rely on the git message
catalog not being available. That's a reasonable assumption since then
the message catalog won't be installed on the system during make
install.
The gettext wrappers that are provided in the patch are only the bare
minimum required to begin translation work. In particular I haven't
added wrappers for the gettext functions that enable plural support,
or those that provide message context (msgctxt).
Those can be added later. The intent is to start with a small subset
and see what we need later, not to start with something that's
unnecessarily large right away.
Implementation and usage notes:
* General:
Gettext .mo files will be installed and looked for in the standard
$(prefix)/share/locale path. GIT_TEXTDOMAINDIR can also be set to
override that, but that's only intended to be used to test Git
itself.
* Perl:
Perl code that wants to be localized should use the new Git::I18n
module. It imports a __ function into the caller's package by
default.
Instead of using the high level Locale::TextDomain interface I've
opted to use the low-level (equivalent to the C interface)
Locale::Messages module, which Locale::TextDomain itself uses.
Locale::TextDomain does a lot of redundant work we don't need, and
some of it would potentially introduce bugs. It tries to set the
$TEXTDOMAIN based on package of the caller, and has its own
hardcoded paths where it'll search for messages.
I found it easier just to completely avoid it rather than try to
circumvent its behavior. In any case, this is an issue wholly
internal Git::I18N. Its guts can be changed later if that's deemed
necessary.
See <AANLkTilYD_NyIZMyj9dHtVk-ylVBfvyxpCC7982LWnVd@mail.gmail.com>
for a further elaboration on this topic.
* Shell:
Shell code that's to be localized should use the new git-sh-i18n
library. It's just a wrapper for the system's gettext.sh.
If gettext.sh isn't available we'll fall back gettext(1) if it's
available. The latter is available without the former on Solaris,
which has its own non-GNU gettext implementation. We also need to
emulate eval_gettext() there.
If neither are present we'll use a dumb printf(1) fall-through
wrapper.
I originally tried to detect if the system supported `echo -n' but
I found this to be a waste of time. My benchmarks on Linux, Solaris
and FreeBSD reveal that printf(1) is fast enough, especially since
we aren't calling gettext() from within any tight loops, and
unlikely to ever do so.
Solaris has its own non-GNU gettext implementation which this patch
supports, although that may change in the future if it turns out that
we need some GNU libintl features that SunOS doesn't provide.
This patch is based on work by Jeff Epler <jepler@unpythonic.net> who
did the initial Makefile / C work, and a lot of comments from the Git
mailing list, including Jonathan Nieder, Jakub Narebski, Johannes
Sixt, Peter Krefting, Junio C Hamano, Thomas Rast and others.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin: use builtin.h for all builtin commands
Change the builtin/*.c files and wt-status.c files which weren't using
builtin.h to use it, also remove any git-compat-util.h, strbuf.h and
cache.h from those files. We can trust on builtin.h including them.
builtin.h also includes commit.h and notes.h. But I haven't removed
these includes. They're redundant now, but we may want to remove them
from builtin.h in the future.
This impeded my efforts to gettextize git, since I'd otherwise have to
add gettext.h to all of these. Using builtin.h is a good idea in any
case, since it's defining the prototypes for the cmd_* functions that
these files define.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Change the builtin/*.c files and wt-status.c files which weren't using
builtin.h to use it, also remove any git-compat-util.h, strbuf.h and
cache.h from those files. We can trust on builtin.h including them.
builtin.h also includes commit.h and notes.h. But I haven't removed
these includes. They're redundant now, but we may want to remove them
from builtin.h in the future.
This impeded my efforts to gettextize git, since I'd otherwise have to
add gettext.h to all of these. Using builtin.h is a good idea in any
case, since it's defining the prototypes for the cmd_* functions that
these files define.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
tests: use test_cmp instead of piping to diff(1)
Change submodule tests that piped to diff(1) to use test_cmp. The
resulting unified diff is easier to read.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Change submodule tests that piped to diff(1) to use test_cmp. The
resulting unified diff is easier to read.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
t7004-tag.sh: re-arrange git tag comment for clarity
Split the "message in editor has initial comment" test into three
tests. The motivation is to be able to only skip the middle part under
NO_GETTEXT_POISON.
In addition the return value of 'git tag' was being returned. We now
check that it's non-zero. I used ! instead of test_must_fail so that
the GIT_EDITOR variable was only used in this command invocation, and
because the surrounding tests use this style.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Split the "message in editor has initial comment" test into three
tests. The motivation is to be able to only skip the middle part under
NO_GETTEXT_POISON.
In addition the return value of 'git tag' was being returned. We now
check that it's non-zero. I used ! instead of test_must_fail so that
the GIT_EDITOR variable was only used in this command invocation, and
because the surrounding tests use this style.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
completion: fix zsh check under bash with 'set -u'
Commit 06f44c3 (completion: make compatible with zsh) broke bash
compatibility with 'set -u': a warning was generated when checking
$ZSH_VERSION. The solution is to supply a default value, using
${ZSH_VERSION-}. Thanks to SZEDER Gábor for the fix.
Signed-off-by: Mark Lodato <lodatom@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Commit 06f44c3 (completion: make compatible with zsh) broke bash
compatibility with 'set -u': a warning was generated when checking
$ZSH_VERSION. The solution is to supply a default value, using
${ZSH_VERSION-}. Thanks to SZEDER Gábor for the fix.
Signed-off-by: Mark Lodato <lodatom@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Merge branch 'ab/send-email-perl'
* ab/send-email-perl:
send-email: extract_valid_address use qr// regexes
send-email: is_rfc2047_quoted use qr// regexes
send-email: use Perl idioms in while loop
send-email: make_message_id use "require" instead of "use"
send-email: send_message die on $!, not $?
send-email: use (?:) instead of () if no match variables are needed
send-email: sanitize_address use qq["foo"], not "\"foo\""
send-email: sanitize_address use $foo, not "$foo"
send-email: use \E***\Q instead of \*\*\*
send-email: cleanup_compose_files doesn't need a prototype
send-email: unique_email_list doesn't need a prototype
send-email: file_declares_8bit_cte doesn't need a prototype
send-email: get_patch_subject doesn't need a prototype
send-email: use lexical filehandles during sending
send-email: use lexical filehandles for $compose
send-email: use lexical filehandle for opendir
Conflicts:
git-send-email.perl
* ab/send-email-perl:
send-email: extract_valid_address use qr// regexes
send-email: is_rfc2047_quoted use qr// regexes
send-email: use Perl idioms in while loop
send-email: make_message_id use "require" instead of "use"
send-email: send_message die on $!, not $?
send-email: use (?:) instead of () if no match variables are needed
send-email: sanitize_address use qq["foo"], not "\"foo\""
send-email: sanitize_address use $foo, not "$foo"
send-email: use \E***\Q instead of \*\*\*
send-email: cleanup_compose_files doesn't need a prototype
send-email: unique_email_list doesn't need a prototype
send-email: file_declares_8bit_cte doesn't need a prototype
send-email: get_patch_subject doesn't need a prototype
send-email: use lexical filehandles during sending
send-email: use lexical filehandles for $compose
send-email: use lexical filehandle for opendir
Conflicts:
git-send-email.perl
Merge branch 'sb/send-email-use-to-from-input'
* sb/send-email-use-to-from-input:
send-email: Don't leak To: headers between patches
send-email: Use To: headers in patch files
Conflicts:
git-send-email.perl
* sb/send-email-use-to-from-input:
send-email: Don't leak To: headers between patches
send-email: Use To: headers in patch files
Conflicts:
git-send-email.perl
Merge branch 'ab/require-perl-5.8'
* ab/require-perl-5.8:
perl: use "use warnings" instead of -w
perl: bump the required Perl version to 5.8 from 5.6.[21]
* ab/require-perl-5.8:
perl: use "use warnings" instead of -w
perl: bump the required Perl version to 5.8 from 5.6.[21]
Merge branch 'kb/merge-recursive-rename-threshold'
* kb/merge-recursive-rename-threshold:
diff: add synonyms for -M, -C, -B
merge-recursive: option to specify rename threshold
Conflicts:
Documentation/diff-options.txt
Documentation/merge-strategies.txt
* kb/merge-recursive-rename-threshold:
diff: add synonyms for -M, -C, -B
merge-recursive: option to specify rename threshold
Conflicts:
Documentation/diff-options.txt
Documentation/merge-strategies.txt
Merge branch 'jp/send-email-to-cmd'
* jp/send-email-to-cmd:
git-send-email.perl: Add --to-cmd
Conflicts:
git-send-email.perl
* jp/send-email-to-cmd:
git-send-email.perl: Add --to-cmd
Conflicts:
git-send-email.perl
Merge branch 'as/daemon-multi-listen'
* as/daemon-multi-listen:
daemon: allow more than one host address given via --listen
daemon: add helper function named_sock_setup
* as/daemon-multi-listen:
daemon: allow more than one host address given via --listen
daemon: add helper function named_sock_setup
Merge branch 'dm/mergetool-vimdiff'
* dm/mergetool-vimdiff:
mergetool-lib: make the three-way diff the default for vim/gvim
mergetool-lib: add a three-way diff view for vim/gvim
mergetool-lib: combine vimdiff and gvimdiff run blocks
* dm/mergetool-vimdiff:
mergetool-lib: make the three-way diff the default for vim/gvim
mergetool-lib: add a three-way diff view for vim/gvim
mergetool-lib: combine vimdiff and gvimdiff run blocks
Merge branch 'kf/post-receive-sample-hook'
* kf/post-receive-sample-hook:
post-receive-email: ensure sent messages are not empty
* kf/post-receive-sample-hook:
post-receive-email: ensure sent messages are not empty
Merge branch 'jf/merge-ignore-ws'
* jf/merge-ignore-ws:
merge-recursive: options to ignore whitespace changes
merge-recursive --patience
ll-merge: replace flag argument with options struct
merge-recursive: expose merge options for builtin merge
* jf/merge-ignore-ws:
merge-recursive: options to ignore whitespace changes
merge-recursive --patience
ll-merge: replace flag argument with options struct
merge-recursive: expose merge options for builtin merge
Merge branch 'ml/completion-zsh'
* ml/completion-zsh:
completion: make compatible with zsh
* ml/completion-zsh:
completion: make compatible with zsh
Merge branch 'po/sendemail'
* po/sendemail:
New send-email option smtpserveroption.
Remove @smtp_host_parts variable as not used.
Minor indentation fix.
* po/sendemail:
New send-email option smtpserveroption.
Remove @smtp_host_parts variable as not used.
Minor indentation fix.