Documentation
¶
Index ¶
- type GlossariesDialog
- func (w *GlossariesDialog) SetAcceptedFunc(accepted func(string, string)) *GlossariesDialog
- func (w *GlossariesDialog) SetCancelFunc(cancel func()) *GlossariesDialog
- func (w *GlossariesDialog) SetDataFunc(data func(string) (deepl.GlossaryInfo, []deepl.GlossaryEntry)) *GlossariesDialog
- func (w *GlossariesDialog) SetOptions(options [][2]string) *GlossariesDialog
- type GlossariesPage
- func (w *GlossariesPage) SetGlossaryCreateFunc(create func(string, string, string, [][2]string))
- func (w *GlossariesPage) SetGlossaryDataFunc(data func(string) (deepl.GlossaryInfo, []deepl.GlossaryEntry)) *GlossariesPage
- func (w *GlossariesPage) SetGlossaryDeleteFunc(del func(string))
- func (w *GlossariesPage) SetGlossaryUpdateFunc(update func(string, string, [][2]string))
- func (w *GlossariesPage) SetLanguageOptions(langs []string) *GlossariesPage
- func (w *GlossariesPage) SetOptions(options [][2]string) *GlossariesPage
- type GlossaryEntryForm
- type GlossaryInfoForm
- type TranslatePage
- type UI
- func (ui *UI) ClearOutputText()
- func (ui *UI) GetInputText() string
- func (ui *UI) SetFooter(text string)
- func (ui *UI) SetFormalityOptions(opts []string, selected func(string, int))
- func (ui *UI) SetGlossaryCreateFunc(handler func(string, string, string, [][2]string))
- func (ui *UI) SetGlossaryDataFunc(handler func(string) (deepl.GlossaryInfo, []deepl.GlossaryEntry))
- func (ui *UI) SetGlossaryDeleteFunc(handler func(string))
- func (ui *UI) SetGlossaryLanguageOptions(langs []string)
- func (ui *UI) SetGlossaryOptions(options [][2]string)
- func (ui *UI) SetGlossarySelectedFunc(handler func(string))
- func (ui *UI) SetGlossaryUpdateFunc(handler func(string, string, [][2]string))
- func (ui *UI) SetInputTextChangedFunc(handler func())
- func (ui *UI) SetSourceLangOptions(opts []string, selected func(string, int))
- func (ui *UI) SetTargetLangOptions(opts []string, selected func(string, int))
- func (ui *UI) WriteOutputText(r io.Reader) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlossariesDialog ¶
GlossariesDialog is used to let the user choose a glossary displays the corresponding entries.
func (*GlossariesDialog) SetAcceptedFunc ¶
func (w *GlossariesDialog) SetAcceptedFunc(accepted func(string, string)) *GlossariesDialog
SetAcceptedFunc sets the handler which is called when the user accepts the current option by selecting the `accept` button. The handler receives the id and name of the selected glossary.
func (*GlossariesDialog) SetCancelFunc ¶
func (w *GlossariesDialog) SetCancelFunc(cancel func()) *GlossariesDialog
SetCancelFunc sets the handler which is called when the user selects the `cancel` button.
func (*GlossariesDialog) SetDataFunc ¶
func (w *GlossariesDialog) SetDataFunc(data func(string) (deepl.GlossaryInfo, []deepl.GlossaryEntry)) *GlossariesDialog
SetDataFunc sets the handler that is used to get the glossary meta information and entries to display when a glossary is selected. The handler receives the id of the glossary.
func (*GlossariesDialog) SetOptions ¶
func (w *GlossariesDialog) SetOptions(options [][2]string) *GlossariesDialog
SetOptions replaces all current glossary options with the ones provided.
type GlossariesPage ¶
GlossariesPage provides widgets to manage glossaries.
func (*GlossariesPage) SetGlossaryCreateFunc ¶
func (w *GlossariesPage) SetGlossaryCreateFunc(create func(string, string, string, [][2]string))
SetGlossaryCreateFunc sets the handler that is called when the user selects the glossary `create` button. The handler receives the name, source lang, target lang and entries for the glossary.
func (*GlossariesPage) SetGlossaryDataFunc ¶
func (w *GlossariesPage) SetGlossaryDataFunc(data func(string) (deepl.GlossaryInfo, []deepl.GlossaryEntry)) *GlossariesPage
SetGlossaryDataFunc sets the handler that is used to get the glossary meta information and entries to display when a glossary is selected. The handler receives the id of the glossary.
func (*GlossariesPage) SetGlossaryDeleteFunc ¶
func (w *GlossariesPage) SetGlossaryDeleteFunc(del func(string))
SetGlossaryDeleteFunc sets the handler that is called when the user selects the glossary `delete` button. The handler receives the id of the glossary.
func (*GlossariesPage) SetGlossaryUpdateFunc ¶
func (w *GlossariesPage) SetGlossaryUpdateFunc(update func(string, string, [][2]string))
SetGlossaryUpdateFunc sets the handler that is called when the user selects the glossary `update` button. The handler receives the id, name and entries of the glossary.
func (*GlossariesPage) SetLanguageOptions ¶
func (w *GlossariesPage) SetLanguageOptions(langs []string) *GlossariesPage
SetLanguageOptions replaces the glossary info form source and target language options with the ones provided.
func (*GlossariesPage) SetOptions ¶
func (w *GlossariesPage) SetOptions(options [][2]string) *GlossariesPage
SetOptions replaces the glossary list items with the ones provided.
type GlossaryEntryForm ¶
GlossaryEntryForm is used to manage glossary entries.
func (*GlossaryEntryForm) SetEntry ¶
func (w *GlossaryEntryForm) SetEntry(entry deepl.GlossaryEntry) *GlossaryEntryForm
type GlossaryInfoForm ¶
GlossaryInfoForm displays glossary meta information in a form layout.
func (*GlossaryInfoForm) SetInfo ¶
func (w *GlossaryInfoForm) SetInfo(info deepl.GlossaryInfo) *GlossaryInfoForm
SetInfo sets the glossary meta information.
func (*GlossaryInfoForm) SetLanguageOptions ¶
func (w *GlossaryInfoForm) SetLanguageOptions(langs []string) *GlossaryInfoForm
SetLanguageOptions replaces all glossary source and target language options with the ones provided.
type TranslatePage ¶
TranslatePage provides widgets to translate input text and specify translation options.
func (*TranslatePage) SetGlossarySelectedFunc ¶
func (w *TranslatePage) SetGlossarySelectedFunc(selected func(string)) *TranslatePage
SetGlossarySelectedFunc sets a handler that is called when a glossary is selected.
type UI ¶
type UI struct { tview.Application // contains filtered or unexported fields }
func (*UI) ClearOutputText ¶
func (ui *UI) ClearOutputText()
func (*UI) GetInputText ¶
func (*UI) SetFormalityOptions ¶
func (*UI) SetGlossaryCreateFunc ¶
func (*UI) SetGlossaryDataFunc ¶
func (ui *UI) SetGlossaryDataFunc(handler func(string) (deepl.GlossaryInfo, []deepl.GlossaryEntry))
SetGlossaryDataFunc sets a handler which can be called by the ui widgets to request glossary data. It receives the glossary ID as an argument.
func (*UI) SetGlossaryDeleteFunc ¶
func (*UI) SetGlossaryLanguageOptions ¶
SetGlossaryLanguageOptions provides the ui with a list of supported glossary languages.
func (*UI) SetGlossaryOptions ¶
SetGlossaryOptions provides the ui with a list of available glossary ids and names.
func (*UI) SetGlossarySelectedFunc ¶
func (*UI) SetGlossaryUpdateFunc ¶
func (*UI) SetInputTextChangedFunc ¶
func (ui *UI) SetInputTextChangedFunc(handler func())
SetInputTextChangedFunc sets a handler that is called when the input text changes.