Re: [PATCH 2/2] i18n: bisect: mark two supplementary strings for translation

2018-06-25 Thread Raphael Hertzog
Hi,

On Thu, 21 Jun 2018, Raphael Hertzog wrote:
> On Thu, 21 Jun 2018, Duy Nguyen wrote:
> > Nice. There's another string in bisect_common() that should also be
> > translated: "revision walk setup failed". Maybe you can mark it too?
> 
> Sure. A new version of the second patch is attached.

I haven't had any other feedback. Is there anything else that I should do
to get my changes merged?

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/


Re: [PATCH 2/2] i18n: bisect: mark two supplementary strings for translation

2018-06-21 Thread Raphael Hertzog
Hi,

On Thu, 21 Jun 2018, Duy Nguyen wrote:
> Nice. There's another string in bisect_common() that should also be
> translated: "revision walk setup failed". Maybe you can mark it too?

Sure. A new version of the second patch is attached.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: https://www.freexian.com/services/debian-lts.html
Learn to master Debian: https://debian-handbook.info/get/
>From 9731f23b9e2f47bdb90e552264c9d030b4f40629 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= 
Date: Thu, 21 Jun 2018 16:06:48 +0200
Subject: [PATCH 2/2] i18n: bisect: mark three supplementary strings for
 translation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The whole bisect procedure is translated but the last message that the
user will see in the process is not translated. Let's fix this.

Also mark the "revision walk setup failed" error message for
translation. It's already used in other files so will not generate
any new string to translate.

Signed-off-by: Raphaël Hertzog 
---
 bisect.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bisect.c b/bisect.c
index a579b5088..4943eb333 100644
--- a/bisect.c
+++ b/bisect.c
@@ -647,7 +647,7 @@ static void bisect_rev_setup(struct rev_info *revs, const char *prefix,
 static void bisect_common(struct rev_info *revs)
 {
 	if (prepare_revision_walk(revs))
-		die("revision walk setup failed");
+		die(_("revision walk setup failed"));
 	if (revs->tree_objects)
 		mark_edges_uninteresting(revs, NULL);
 }
@@ -658,8 +658,8 @@ static void exit_if_skipped_commits(struct commit_list *tried,
 	if (!tried)
 		return;
 
-	printf("There are only 'skip'ped commits left to test.\n"
-	   "The first %s commit could be any of:\n", term_bad);
+	printf(_("There are only 'skip'ped commits left to test.\n"
+		 "The first %s commit could be any of:\n"), term_bad);
 
 	for ( ; tried; tried = tried->next)
 		printf("%s\n", oid_to_hex(>item->object.oid));
@@ -984,7 +984,7 @@ int bisect_next_all(const char *prefix, int no_checkout)
 
 	if (!oidcmp(bisect_rev, current_bad_oid)) {
 		exit_if_skipped_commits(tried, current_bad_oid);
-		printf("%s is the first %s commit\n", oid_to_hex(bisect_rev),
+		printf(_("%s is the first %s commit\n"), oid_to_hex(bisect_rev),
 			term_bad);
 		show_diff_tree(prefix, revs.commits->item);
 		/* This means the bisection process succeeded. */
-- 
2.18.0.rc2



Re: git: problematic git status output with some translations (such as fr_FR)

2014-01-16 Thread Raphael Hertzog
Hi,

On Fri, 20 Dec 2013, Duy Nguyen wrote:
 On Fri, Dec 20, 2013 at 3:50 AM, Jonathan Nieder jrnie...@gmail.com wrote:
  Junio C Hamano wrote:
  Jonathan Nieder jrnie...@gmail.com writes:
 
  This includes the colon in the translated string, to make it easier to
  remember to keep the non-breaking space before it.
 
  Hmph, recent 3651e45c (wt-status: take the alignment burden off
  translators, 2013-11-05) seems to have gone in the different
  direction when it updated similar code for the non-unmerged paths.
 
  Yes, if this seems to go in the right direction, I'd add a follow-up
  for that when rerolling.
 
 i'm fine either way.

In both cases, the alignment burden is taken off the translators. But I
agree that it's best to keep the colon in the translatable string so that
translators can add the space required by proper typography.

So I'd favor Jonathan's approach. I just tested his patch and it
solves the immediate problem for me. Without the patch I have this
(French translation):

| Chemins non fusionnés :
|   (utilisez git add fichier... pour marquer comme résolu)
| 
|   modifié des deux côtés :fichier

And with it:

| Chemins non fusionnés :
|   (utilisez git add fichier... pour marquer comme résolu)
| 
|   modifié des deux côtés : fichier

However it looks like the padding is calculated on bytes
and not on (wide) characters, so we have 3 extra spaces before
the filename (one for ô, é, and the non-breaking space).
This can be problematic for translations where all characters
require multiple bytes. :-)

The patch is also incomplete since it currently breaks
the test suite in multiple places (the unnecessary padding
before the filename goes away), for example:

--- expected2014-01-16 21:37:11.270535950 +
+++ actual  2014-01-16 21:37:11.270535950 +
@@ -5,7 +5,7 @@
 Unmerged paths:
   (use git add/rm file... as appropriate to mark resolution)
 
-   both added: conflict.txt
-   deleted by them:main.txt
+   both added:  conflict.txt
+   deleted by them: main.txt
 
 no changes added to commit (use git add and/or git commit -a)
not ok 11 - status when conflicts with add and rm advice (deleted by them)


That was my two euros to help get this fixed because it annoys me
quite often.

Cheers,

-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html