Git development
 help / color / mirror / Atom feed
From: Michele Ballabio <barra_cuda@katamail.com>
To: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Cc: spearce@spearce.org, git@vger.kernel.org
Subject: [PATCH] git-gui: add a part about format strings in po/README
Date: Sun, 3 Aug 2008 13:12:14 +0200	[thread overview]
Message-ID: <200808031312.14804.barra_cuda@katamail.com> (raw)
In-Reply-To: <20080803121131.589e672b@paolo-desktop>

This should help tranlators that need to reorder words and strings.
Original explanation by Christian Stimming.

Also remove unneeded backslashes.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
---

On Sunday 03 August 2008, Paolo Ciarrocchi wrote:
> Shawn,
> a simple make in the git-gui-i18n repository fails with the following msg:
> paolo@paolo-desktop:~/git-gui-i18n$ make
> GITGUI_VERSION = 0.9.GITGUI-dirty
>     * new locations or Tcl/Tk interpreter
>     GEN git-gui
>     INDEX lib/
>     MSGFMT    po/bg.msg 391 translated.
>     MSGFMT    po/de.msg 383 translated, 5 fuzzy, 3 untranslated.
>     MSGFMT    po/es.msg 122 translated, 269 untranslated.
>     MSGFMT    po/fr.msg 391 translated.
>     MSGFMT    po/hu.msg 391 translated.
>     MSGFMT    po/it.msg make: *** [po/it.msg] Error 1
> 
> Before and after the following patch :-)

I think that's this commit: c6fb29db5a50df150280b641d3c2a6703589b529
(Fixed usage of positional parameters in it.po and ja.po).
It didn't fix anything and was harmful instead.

Maybe this patch could be useful.

 po/README |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/po/README b/po/README
index 5e77a7d..595bbf5 100644
--- a/po/README
+++ b/po/README
@@ -101,7 +101,7 @@ matching msgid lines.  A few tips:
    "printf()"-like functions.  Make sure "%s", "%d", and "%%" in your
    translated messages match the original.
 
-   When you have to change the order of words, you can add "<number>\$"
+   When you have to change the order of words, you can add "<number>$"
    between '%' and the conversion ('s', 'd', etc.) to say "<number>-th
    parameter to the format string is used at this point".  For example,
    if the original message is like this:
@@ -111,12 +111,17 @@ matching msgid lines.  A few tips:
    and if for whatever reason your translation needs to say weight first
    and then length, you can say something like:
 
-	"WEIGHT IS %2\$d, LENGTH IS %1\$d"
+	"WEIGHT IS %2$d, LENGTH IS %1$d"
 
-   The reason you need a backslash before dollar sign is because
-   this is a double quoted string in Tcl language, and without
-   it the letter introduces a variable interpolation, which you
-   do not want here.
+   A format specification with a '*' (asterisk) refers to *two* arguments
+   instead of one, hence the succeeding argument number is two higher
+   instead of one. So, a message like this
+
+	"%s ... %*i of %*i %s (%3i%%)"
+
+   is equivalent to
+
+	"%1$s ... %2$*i of %4$*i %6$s (%7$3i%%)"
 
  - A long message can be split across multiple lines by ending the
    string with a double quote, and starting another string on the next
-- 
1.6.0.rc1

  reply	other threads:[~2008-08-03 11:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-03 10:11 [PATCH] Update to it.po Paolo Ciarrocchi
2008-08-03 11:12 ` Michele Ballabio [this message]
2008-08-03 11:49 ` Michele Ballabio
2008-08-03 12:16   ` Paolo Ciarrocchi
2008-08-03 14:24     ` Michele Ballabio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200808031312.14804.barra_cuda@katamail.com \
    --to=barra_cuda@katamail.com \
    --cc=git@vger.kernel.org \
    --cc=paolo.ciarrocchi@gmail.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox