Skip to content

Commit cab31fa

Browse files
committed
Merge git://repo.or.cz/git-gui
* git://repo.or.cz/git-gui: git-gui: Correctly cleanup msgfmt '1 message untranslated' output git-gui: Make the statistics of po2msg match those of msgfmt git-gui: Fallback to Tcl based po2msg.sh if msgfmt isn't available git-gui: Work around random missing scrollbar in revision list
2 parents 5a9dd39 + 3b8f19a commit cab31fa

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

git-gui/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ ifndef V
6767
QUIET_GEN = $(QUIET)echo ' ' GEN '$@' &&
6868
QUIET_INDEX = $(QUIET)echo ' ' INDEX $(dir $@) &&
6969
QUIET_MSGFMT0 = $(QUIET)printf ' MSGFMT %12s ' $@ && v=`
70-
QUIET_MSGFMT1 = 2>&1` && echo "$$v" | sed -e 's/fuzzy translations/fuzzy/' | sed -e 's/ messages//g'
70+
QUIET_MSGFMT1 = 2>&1` && echo "$$v" | sed -e 's/fuzzy translations/fuzzy/' | sed -e 's/ messages*//g'
7171
QUIET_2DEVNULL = 2>/dev/null
7272

7373
INSTALL_D0 = dir=
@@ -198,6 +198,9 @@ ifdef NO_MSGFMT
198198
MSGFMT ?= $(TCL_PATH) po/po2msg.sh
199199
else
200200
MSGFMT ?= msgfmt
201+
ifeq ($(shell $(MSGFMT) >/dev/null 2>&1 || echo $$?),127)
202+
MSGFMT := $(TCL_PATH) po/po2msg.sh
203+
endif
201204
endif
202205

203206
msgsdir = $(gg_libdir)/msgs

git-gui/lib/choose_rev.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,8 @@ method _sb_set {sb orient first last} {
451451
focus $old_focus
452452
}
453453
}
454-
$sb set $first $last
454+
455+
catch {$sb set $first $last}
455456
}
456457

457458
method _show_tooltip {pos} {

git-gui/po/po2msg.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,26 @@ foreach file $files {
127127
}
128128

129129
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
133152
}

0 commit comments

Comments
 (0)