# [PATCH] i18n: make the translation of -u advise in one go

4 messages from 2013-04-12 to 2013-04-12. Participants: Jiang Xin, Eric Sunshine, Jonathan Nieder.
Thread: https://gitlist.dev/t/33486

## Jiang Xin, 2013-04-12 02:46

Subject: [PATCH] i18n: make the translation of -u advise in one go
Message-ID: <4003e29bb04b122897cefe2a8057266e2428dce5.1365734618.git.worldhello.net@gmail.com>
URL: https://gitlist.dev/e/4003e29bb04b122897cefe2a8057266e2428dce5.1365734618.git.worldhello.net%40gmail.com

```
The advise (consider use of -u when read_directory takes too long) is
separated into 3 different status_printf_ln() calls, and which brings
trouble for translators.

Since status_vprintf() called by status_printf_ln() can handle eol in
buffer, we could simply join these lines into one paragraph.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
---
 wt-status.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index 09416..f0d3 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1223,16 +1223,12 @@ void wt_status_print(struct wt_status *s)
 		if (s->show_ignored_files)
 			wt_status_print_other(s, &s->ignored, _("Ignored files"), "add -f");
 		if (advice_status_u_option && 2000 < s->untracked_in_ms) {
-			status_printf_ln(s, GIT_COLOR_NORMAL, "");
 			status_printf_ln(s, GIT_COLOR_NORMAL,
-				 _("It took %.2f seconds to enumerate untracked files."
-				   "  'status -uno'"),
-				 s->untracked_in_ms / 1000.0);
-			status_printf_ln(s, GIT_COLOR_NORMAL,
-				 _("may speed it up, but you have to be careful not"
-				   " to forget to add"));
-			status_printf_ln(s, GIT_COLOR_NORMAL,
-				 _("new files yourself (see 'git help status')."));
+					 _("\n"
+					   "It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
+					   "may speed it up, but you have to be careful not to forget to add\n"
+					   "new files yourself (see 'git help status')."),
+					 s->untracked_in_ms / 1000.0);
 		}
 	} else if (s->commitable)
 		status_printf_ln(s, GIT_COLOR_NORMAL, _("Untracked files not listed%s"),
-- 
1.8.2.1.347.g1003b3a.dirty

```

## Eric Sunshine, 2013-04-12 02:53

Subject: Re: [PATCH] i18n: make the translation of -u advise in one go
Message-ID: <CAPig+cRu7kAsfqftuoC0HDZ3fRTXLC4j21God4SRk67psWR=1g@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcRu7kAsfqftuoC0HDZ3fRTXLC4j21God4SRk67psWR%3D1g%40mail.gmail.com
In-Reply-To: <4003e29bb04b122897cefe2a8057266e2428dce5.1365734618.git.worldhello.net@gmail.com>

```
On Thu, Apr 11, 2013 at 10:46 PM, Jiang Xin <worldhello.net@gmail.com> wrote:
> i18n: make the translation of -u advise in one go

s/advise/advice/

> The advise (consider use of -u when read_directory takes too long) is

Ditto: s/advise/advice/

> separated into 3 different status_printf_ln() calls, and which brings
> trouble for translators.
>
> Since status_vprintf() called by status_printf_ln() can handle eol in
> buffer, we could simply join these lines into one paragraph.
>
> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>

```

## Jonathan Nieder, 2013-04-12 02:55

Subject: Re: [PATCH] i18n: make the translation of -u advise in one go
Message-ID: <20130412025501.GB3266@elie.Belkin>
URL: https://gitlist.dev/e/20130412025501.GB3266%40elie.Belkin
In-Reply-To: <4003e29bb04b122897cefe2a8057266e2428dce5.1365734618.git.worldhello.net@gmail.com>

```
Hi,

Jiang Xin wrote:

> Since status_vprintf() called by status_printf_ln() can handle eol in
> buffer, we could simply join these lines into one paragraph.

Good idea.

[...]
> --- a/wt-status.c
> +++ b/wt-status.c
> @@ -1223,16 +1223,12 @@ void wt_status_print(struct wt_status *s)
>  		if (s->show_ignored_files)
>  			wt_status_print_other(s, &s->ignored, _("Ignored files"), "add -f");
>  		if (advice_status_u_option && 2000 < s->untracked_in_ms) {
> -			status_printf_ln(s, GIT_COLOR_NORMAL, "");

Tiny nit: I'd suggest keeping the above line, making it:

			status_printf_ln(s, GIT_COLOR_NORMAL, "");
			status_printf_ln(s, GIT_COLOR_NORMAL,
					_("It took ..."
					  "... status')."),
					s->untracked_in_ms / 1000.0);

That way, the message to be translated doesn't start with a newline,
so translators don't have to worry about preserving it (or removing
it if the layout ever changes in the future, etc).

With that change,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Thanks.

```

## Jiang Xin, 2013-04-12 03:53

Subject: [PATCH v2] i18n: make the translation of -u advice in one go
Message-ID: <7df2833fe51c614bf9a2a6208df2e09d913a046e.1365738420.git.worldhello.net@gmail.com>
URL: https://gitlist.dev/e/7df2833fe51c614bf9a2a6208df2e09d913a046e.1365738420.git.worldhello.net%40gmail.com
In-Reply-To: <20130412025501.GB3266@elie.Belkin>

```
The advice (consider use of -u when read_directory takes too long) is
separated into 3 different status_printf_ln() calls, and which brings
trouble for translators.

Since status_vprintf() called by status_printf_ln() can handle eol in
buffer, we could simply join these lines into one paragraph.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
---
 wt-status.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index 09416..ec5f2 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1225,14 +1225,10 @@ void wt_status_print(struct wt_status *s)
 		if (advice_status_u_option && 2000 < s->untracked_in_ms) {
 			status_printf_ln(s, GIT_COLOR_NORMAL, "");
 			status_printf_ln(s, GIT_COLOR_NORMAL,
-				 _("It took %.2f seconds to enumerate untracked files."
-				   "  'status -uno'"),
-				 s->untracked_in_ms / 1000.0);
-			status_printf_ln(s, GIT_COLOR_NORMAL,
-				 _("may speed it up, but you have to be careful not"
-				   " to forget to add"));
-			status_printf_ln(s, GIT_COLOR_NORMAL,
-				 _("new files yourself (see 'git help status')."));
+					 _("It took %.2f seconds to enumerate untracked files. 'status -uno'\n"
+					   "may speed it up, but you have to be careful not to forget to add\n"
+					   "new files yourself (see 'git help status')."),
+					 s->untracked_in_ms / 1000.0);
 		}
 	} else if (s->commitable)
 		status_printf_ln(s, GIT_COLOR_NORMAL, _("Untracked files not listed%s"),
-- 
1.8.2.1.347.g1003b3a.dirty

```
