Skip to content

Commit

Permalink
Fix glossary selection
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed Jul 16, 2024
1 parent 74b9753 commit adbe95a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/deepl/cli.cr
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,13 @@ module DeepL
when 2..
creation_times = glossary_info_list.map { |g| g.creation_time }
prompt = Term::Prompt.new
tm = prompt.multi_select("Select creation date", creation_times)
glossary_info = glossary_info_list.find { |g| g.creation_time == tm }.not_nil!
edit_glossary_core(translator, glossary_info)
tm = prompt.select("Select creation date", creation_times)
glossary_info = glossary_info_list.find { |g| g.creation_time == tm }
if glossary_info.nil?
STDERR.puts "[deepl-cli] Glossary #{glossary_name} #{tm} is not found"
else
edit_glossary_core(translator, glossary_info)
end
when 1
glossary_info = glossary_info_list.first
edit_glossary_core(translator, glossary_info)
Expand Down

0 comments on commit adbe95a

Please sign in to comment.