summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d0bfd5c)
raw | patch | inline | side by side (parent: d0bfd5c)
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Sat, 28 Aug 2010 15:32:15 +0000 (15:32 +0000) | ||
committer | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | |
Sat, 30 Oct 2010 07:10:07 +0000 (07:10 +0000) |
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>
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>
builtin/init-db.c | patch | blob | history | |
t/t0001-init.sh | patch | blob | history |
diff --git a/builtin/init-db.c b/builtin/init-db.c
index 7b339adf830e384ea18383e6bccf1cb7e75f7759..28e20f9607497e5fe35632b9fb2ddac44ac5004c 100644 (file)
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
if (!(flags & INIT_DB_QUIET)) {
const char *git_dir = get_git_dir();
int len = strlen(git_dir);
- printf("%s%s Git repository in %s%s\n",
- reinit ? "Reinitialized existing" : "Initialized empty",
- shared_repository ? " shared" : "",
+
+ /* TRANSLATORS: The first '%s' is either "Reinitialized
+ existing" or "Initialized empty", the second " shared" or
+ "", and the last '%s%s' is the verbatim directory name. */
+ printf(_("%s%s Git repository in %s%s\n"),
+ reinit ? _("Reinitialized existing") : _("Initialized empty"),
+ shared_repository ? _(" shared") : "",
git_dir, len && git_dir[len-1] != '/' ? "/" : "");
}
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 7fe8883ae060947da804abb5b287fb94d19e87c4..b45df242b1f1929ef0a1cdf415a1cdc7cfa439e2 100755 (executable)
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
fi
'
-test_expect_success 'reinit' '
+test_expect_success NO_GETTEXT_POISON 'reinit' '
(
unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG