From 070b7e441649b9c2543fda7bfbef0ad58761f869 Mon Sep 17 00:00:00 2001 From: Vasco Almeida Date: Fri, 17 Jun 2016 20:20:50 +0000 Subject: i18n: builtin/remote.c: fix mark for translation The second string inside _() was not being extracted for translation by xgettext, meaning that, although the string was passed to gettext, there was no translation available. Mark each individual string instead of marking the result of ternary if. Signed-off-by: Vasco Almeida Signed-off-by: Junio C Hamano --- builtin/remote.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'builtin/remote.c') diff --git a/builtin/remote.c b/builtin/remote.c index d33766be39..ae74da64b2 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -963,9 +963,9 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data) printf(" %-*s ", show_info->width, item->string); if (branch_info->rebase) { - printf_ln(_(branch_info->rebase == INTERACTIVE_REBASE ? - "rebases interactively onto remote %s" : - "rebases onto remote %s"), merge->items[0].string); + printf_ln(branch_info->rebase == INTERACTIVE_REBASE + ? _("rebases interactively onto remote %s") + : _("rebases onto remote %s"), merge->items[0].string); return 0; } else if (show_info->any_rebase) { printf_ln(_(" merges with remote %s"), merge->items[0].string); -- cgit v1.2.1 From 7ba7b9abcc6f683f3b18315495d30811a6bc9e12 Mon Sep 17 00:00:00 2001 From: Vasco Almeida Date: Fri, 17 Jun 2016 20:21:21 +0000 Subject: i18n: remote: mark URL fallback text for translation Marks fallback text for translation that may be displayed in git remote show output. Signed-off-by: Vasco Almeida Signed-off-by: Junio C Hamano --- builtin/remote.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'builtin/remote.c') diff --git a/builtin/remote.c b/builtin/remote.c index ae74da64b2..9f934cb7e8 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -1158,11 +1158,11 @@ static int show(int argc, const char **argv) the one in " Fetch URL: %s" translation */ printf_ln(_(" Push URL: %s"), url[i]); if (!i) - printf_ln(_(" Push URL: %s"), "(no URL)"); + printf_ln(_(" Push URL: %s"), _("(no URL)")); if (no_query) - printf_ln(_(" HEAD branch: %s"), "(not queried)"); + printf_ln(_(" HEAD branch: %s"), _("(not queried)")); else if (!states.heads.nr) - printf_ln(_(" HEAD branch: %s"), "(unknown)"); + printf_ln(_(" HEAD branch: %s"), _("(unknown)")); else if (states.heads.nr == 1) printf_ln(_(" HEAD branch: %s"), states.heads.items[0].string); else { -- cgit v1.2.1 From a1b467a4eee547973709ee4e1473febd8d1b4c85 Mon Sep 17 00:00:00 2001 From: Vasco Almeida Date: Fri, 17 Jun 2016 20:21:22 +0000 Subject: i18n: remote: allow translations to reorder message Before this patch, translations couldn't place the branch name where it was better fit in the message "and with remote ". Allow translations that, instead of forcing the branch name to display right of the message. Signed-off-by: Vasco Almeida Signed-off-by: Junio C Hamano --- builtin/remote.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'builtin/remote.c') diff --git a/builtin/remote.c b/builtin/remote.c index 9f934cb7e8..7f0f78b8fc 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -952,7 +952,7 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data) struct show_info *show_info = cb_data; struct branch_info *branch_info = item->util; struct string_list *merge = &branch_info->merge; - const char *also; + int width = show_info->width + 4; int i; if (branch_info->rebase && branch_info->merge.nr > 1) { @@ -969,13 +969,12 @@ static int show_local_info_item(struct string_list_item *item, void *cb_data) return 0; } else if (show_info->any_rebase) { printf_ln(_(" merges with remote %s"), merge->items[0].string); - also = _(" and with remote"); + width++; } else { printf_ln(_("merges with remote %s"), merge->items[0].string); - also = _(" and with remote"); } for (i = 1; i < merge->nr; i++) - printf(" %-*s %s %s\n", show_info->width, "", also, + printf(_("%-*s and with remote %s\n"), width, "", merge->items[i].string); return 0; -- cgit v1.2.1