summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-01-23 04:52:07 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2008-01-23 04:52:07 (GMT)
commit2cd9ad2e71c57b283e8caf03de065bba1dff5f5f (patch)
treee7ae6b8b8c8e00ed9f31047a97696683f95e5bfd
parent3470adabad8c02be152a8d536d23df692eb386d6 (diff)
downloadgit-2cd9ad2e71c57b283e8caf03de065bba1dff5f5f.zip
git-2cd9ad2e71c57b283e8caf03de065bba1dff5f5f.tar.gz
git-2cd9ad2e71c57b283e8caf03de065bba1dff5f5f.tar.bz2
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>
-rw-r--r--po/po2msg.sh25
1 files changed, 22 insertions, 3 deletions
diff --git a/po/po2msg.sh b/po/po2msg.sh
index c63248e..b7c4bf3 100644
--- a/po/po2msg.sh
+++ b/po/po2msg.sh
@@ -127,7 +127,26 @@ foreach file $files {
}
if {$show_statistics} {
- puts [concat "$translated_count translated messages, " \
- "$fuzzy_count fuzzy ones, " \
- "$not_translated_count untranslated ones."]
+ set str ""
+
+ append str "$translated_count translated message"
+ if {$translated_count != 1} {
+ append str s
+ }
+
+ if {$fuzzy_count > 1} {
+ append str ", $fuzzy_count fuzzy translation"
+ if {$fuzzy_count != 1} {
+ append str s
+ }
+ }
+ if {$not_translated_count > 0} {
+ append str ", $not_translated_count untranslated message"
+ if {$not_translated_count != 1} {
+ append str s
+ }
+ }
+
+ append str .
+ puts $str
}