Skip to contentSkip to conversation

git-gui: i18n introductory document (2nd draft)

DISCUSSION Brett Schwarz 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw
Quoted 11 lines

----- Original Message ----
From: Christian Stimming <[email protected]>
To: Junio C Hamano <[email protected]>
Cc: [email protected]; Irina Riesen <[email protected]>; Johannes Schindelin <[email protected]>; Nanako Shiraishi <[email protected]>; Paolo Ciarrocchi <[email protected]>; Shawn O. Pearce <[email protected]>; Xudong Guan <[email protected]>; [email protected]
Sent: Friday, July 27, 2007 8:21:58 AM
Subject: Re: git-gui: i18n introductory document (2nd draft)

Junio C Hamano <[email protected]> schrieb am 27.07.2007 01:31:06:

Quoted 2 lines

I have tried to address issues raised in Christian's comments on the first draft that was circulated privately.

<snip>

Quoted 15 lines
Quoted 14 lines

+ - Often the messages being translated are format strings given to

(quoted diff) +12 -0
+   "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>$"
+   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:
+
+   "Length is %d, Weight is %d"
+
+   and if for whatever reason your translation needs to say weight first
+   and then length, you can say something like:
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+
+   "WEIGHT IS %2$d, LENGTH IS %1$d"

Since we are using quotes for the strings, and Tcl will do a round of substitutions
and will think those $d's are variables, you might want to change that to:

        "WEIGHT IS %2\$d, LENGTH IS %1\$d"

You also may want to add a note about why the backslash

Quoted 4 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+
+   [NEEDSWORK: this whole "parameter permutation" part needs to be
+   verified if it works with Tcl at all]
bschwarz@desk1:~$ tclsh
% package require msgcat
1.3.4
% namespace import ::msgcat::*
% mcset en_us_brett "L is %d, W is %d" "WEIGHT IS %2\$d, LENGTH IS %1\$d" 
WEIGHT IS %2$d, LENGTH IS %1$d
% mcset en_us "L is %d, W is %d" "Length is %d, Weight is %d"
Length is %d, Weight is %d
% mclocale en_us
en_us
% set length 74
74
% set weight 220
220
% mc "L is %d, W is %d" $length $weight
Length is 74, Weight is 220
% mclocale en_us_brett
en_us_brett
% mc "L is %d, W is %d" $length $weight
WEIGHT IS 220, LENGTH IS 74
% 

Seems to work...

Regards,

     --brett

____________________________________________________________________________________
Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.
http://new.toolbar.yahoo.com/toolbar/features/norton/index.php