Cleaner singular/plural strings for match count notification.
This commit is contained in:
parent
33479dfc4b
commit
8d51c1070c
2 changed files with 7 additions and 3 deletions
|
@ -248,7 +248,7 @@ module Diakonos
|
||||||
}
|
}
|
||||||
|
|
||||||
choice = auto_choice || $diakonos.get_choice(
|
choice = auto_choice || $diakonos.get_choice(
|
||||||
"#{num_matches_found} match(es) - Replace this one?",
|
"#{num_matches_found} match#{ num_matches_found != 1 ? 'es' : '' } - Replace this one?",
|
||||||
[ CHOICE_YES, CHOICE_NO, CHOICE_ALL, CHOICE_CANCEL, CHOICE_YES_AND_STOP ],
|
[ CHOICE_YES, CHOICE_NO, CHOICE_ALL, CHOICE_CANCEL, CHOICE_YES_AND_STOP ],
|
||||||
CHOICE_YES
|
CHOICE_YES
|
||||||
)
|
)
|
||||||
|
|
|
@ -140,10 +140,14 @@ module Diakonos
|
||||||
def show_number_of_matches_found( num_replacements = nil )
|
def show_number_of_matches_found( num_replacements = nil )
|
||||||
return if buffer_current.num_matches_found.nil?
|
return if buffer_current.num_matches_found.nil?
|
||||||
|
|
||||||
|
num_found = buffer_current.num_matches_found
|
||||||
|
if num_found != 1
|
||||||
|
plural = 'es'
|
||||||
|
end
|
||||||
if num_replacements
|
if num_replacements
|
||||||
set_iline_if_empty "#{num_replacements} out of #{buffer_current.num_matches_found} match(es) replaced"
|
set_iline_if_empty "#{num_replacements} out of #{num_found} match#{plural} replaced"
|
||||||
else
|
else
|
||||||
set_iline_if_empty "#{buffer_current.num_matches_found} match(es) found"
|
set_iline_if_empty "#{num_found} match#{plural} found"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue