Re: [PATCH 03/10] i18n: mark relative dates for translation

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 03/10] i18n: mark relative dates for translation

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:40

Jonathan Nieder [off-list ref] writes:
Nguyen Thai Ngoc Duy wrote:
quoted
2012/4/25 Junio C Hamano [off-list ref]:
quoted
quoted
quoted
+     strbuf_addf(timebuf,
+              Q_("%lu year ago", "%lu years ago", (diff + 183) / 365),
+              (diff + 183) / 365);
 }
This is just a tangent, but could we possibly come here and say "1 year
ago"?
Nice catch. Singular form here is unnecessary.
I think Junio meant

			Q_("1 year ago", "%lu years ago", ...)
No, I was just being stupid---what I meant was that diff will be so
large that this will always be feeding more than 1 to %lu, so the first
template string will never be used.

But it cannot be N_("%lu years ago", number), as others correctly
pointed out.  We want to use ngettext() here, because it is not enough
to know that number is always greater than 1 to correctly phrase this in
some languages.

Re: [PATCH 03/10] i18n: mark relative dates for translation

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:53:40

Junio C Hamano wrote:
                              what I meant was that diff will be so
large that this will always be feeding more than 1 to %lu, so the first
template string will never be used.

But it cannot be N_("%lu years ago", number), as others correctly
pointed out.  We want to use ngettext() here, because it is not enough
to know that number is always greater than 1 to correctly phrase this in
some languages.
Ah, I see now.  Thanks for a patient explanation.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help