git-gui: Make the statistics of po2msg match those of msgfmt
The strings we were showing from po2msg didn't exactly match those of msgfmt's --statistics output so we didn't show quite the same results when building git-gui's message files. Now we're closer to what msgfmt shows (at least for an en_US locale) so the make output matches. I noticed that the fuzzy translation count is off by one for the current po/zh_cn.po file. Not sure why and I'm not going to try and debug it at this time as the po2msg is strictly a fallback, users building from source really should prefer msgfmt. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Shawn O. Pearce committed
Jan 22, 2008 at 23:52 UTC
2cd9ad2e71c57b283e8caf03de065bba1dff5f5f
1 file changed
+22
-3
po/po2msg.sh
+22
-3
@@ -127,7 +127,26 @@ foreach file $files {
127
}
128
129
if {$show_statistics} {
130
- puts [concat "$translated_count translated messages, " \
131
- "$fuzzy_count fuzzy ones, " \
132
- "$not_translated_count untranslated ones."]
130
+ set str ""
131
+
132
+ append str "$translated_count translated message"
133
+ if {$translated_count != 1} {
134
+ append str s
135
+ }
136
+
137
+ if {$fuzzy_count > 1} {
138
+ append str ", $fuzzy_count fuzzy translation"
139
+ if {$fuzzy_count != 1} {
140
+ append str s
141
+ }
142
+ }
143
+ if {$not_translated_count > 0} {
144
+ append str ", $not_translated_count untranslated message"
145
+ if {$not_translated_count != 1} {
146
+ append str s
147
+ }
148
+ }
149
+
150
+ append str .
151
+ puts $str
152
}