Thread (21 messages) flat view 21 messages, 5 authors, 2016-06-15

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

From: Zbigniew Jędrzejewski-Szmek <hidden>
Date: 2016-06-15 22:53:40

On 04/25/2012 01:07 PM, Johannes Sixt wrote:
Am 4/25/2012 12:46, schrieb Nguyen Thai Ngoc Duy:
quoted
2012/4/25 Junio C Hamano [off-list ref]:
quoted
quoted
      /* Give years and months for 5 years or so */
      if (diff < 1825) {
...
      }
      /* Otherwise, just years. Centuries is probably overkill. */
-     snprintf(timebuf, timebuf_size, "%lu years ago", (diff + 183) / 365);
-     return timebuf;
+     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. If you plan to revert
that, please put a comment so nobody will attempt to convert it to
Q_() again next time while searching for possible candidates.
I am sure that there are languages (Russian? Polish?) where a variation is
needed not only for the singular, but also for plural depending on the
number, so we still want to have this wrapped in Q_().
Yeah, both Polish and Russian...

Polish:
Plural-Forms: nplurals=3; \
  plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);

Russian:
Plural-Forms: nplurals=3; \
              plural=n%10==1 && n%100!=11 ? 0 : \
                     n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;

Looking at http://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Plural-forms.html, basically all languages which have nplurals=3 or nplurals=4.

Zbyszek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help