@matheusbsbs / matheus-bagliano / commits / 3e5dd7e960
Fork 0

i18n: git-init "Initialized [...] repository" message

These messages could benefit from splitting up. An earlier version of this patch 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. So just add a comment explaining to translators how the sprintf format gets used so they can cope for now if the language's grammar allows. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Feb 22, 2011 at 23:41 UTC 3e5dd7e960953ad03790309c48406a8aa43cb026
2 files changed +10 -4
builtin/init-db.c
+9 -3
@@ -354,9 +354,15 @@ int init_db(const char *template_dir, unsigned int flags)
354 if (!(flags & INIT_DB_QUIET)) {
355 const char *git_dir = get_git_dir();
356 int len = strlen(git_dir);
357 - printf("%s%s Git repository in %s%s\n",
358 - reinit ? "Reinitialized existing" : "Initialized empty",
359 - shared_repository ? " shared" : "",
357 +
358 + /*
359 + * TRANSLATORS: The first '%s' is either "Reinitialized
360 + * existing" or "Initialized empty", the second " shared" or
361 + * "", and the last '%s%s' is the verbatim directory name.
362 + */
363 + printf(_("%s%s Git repository in %s%s\n"),
364 + reinit ? _("Reinitialized existing") : _("Initialized empty"),
365 + shared_repository ? _(" shared") : "",
366 git_dir, len && git_dir[len-1] != '/' ? "/" : "");
367 }
368
t/t0001-init.sh
+1 -1
@@ -180,7 +180,7 @@ test_expect_success 'GIT_DIR & GIT_WORK_TREE (2)' '
180 fi
181 '
182
183 -test_expect_success 'reinit' '
183 +test_expect_success C_LOCALE_OUTPUT 'reinit' '
184
185 (
186 sane_unset GIT_CONFIG GIT_WORK_TREE GIT_CONFIG &&