summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7cce5b2)
raw | patch | inline | side by side (parent: 7cce5b2)
author | Michele Ballabio <barra_cuda@katamail.com> | |
Sun, 3 Aug 2008 11:12:14 +0000 (13:12 +0200) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 3 Aug 2008 20:53:42 +0000 (13:53 -0700) |
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>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Original explanation by Christian Stimming.
Also remove unneeded backslashes.
Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
po/README | patch | blob | history |
diff --git a/po/README b/po/README
index 5e77a7d7d2d9e82311c1573035fa020c8d08b38c..595bbf5dee97e34eeab46b742225fce2f95ab052 100644 (file)
--- a/po/README
+++ b/po/README
"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:
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