mirror of
https://github.com/eeeXun/GTT.git
synced 2025-05-19 01:00:20 -07:00
update comment
This commit is contained in:
parent
e313d326f3
commit
45da8702c6
@ -4,7 +4,7 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// search XDG_CONFIG_HOME or $HOME/.config
|
||||
// Search XDG_CONFIG_HOME or $HOME/.config
|
||||
func configInit() {
|
||||
var defaultConfigPath string
|
||||
|
||||
@ -37,6 +37,7 @@ func configInit() {
|
||||
translator.dstLang = config.GetString("destination.language")
|
||||
}
|
||||
|
||||
// Check if need to modify config file when quit program
|
||||
func updateConfig() {
|
||||
changed := false
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package main
|
||||
|
||||
// https://cloud.google.com/translate/docs/languages
|
||||
var (
|
||||
Lang = []string{
|
||||
"Afrikaans",
|
||||
|
@ -86,6 +86,7 @@ func (t *Translator) Translate(message string) (string, error) {
|
||||
}
|
||||
return translated, nil
|
||||
}
|
||||
|
||||
return "", errors.New("Translation not found")
|
||||
}
|
||||
|
||||
|
8
ui.go
8
ui.go
@ -103,7 +103,7 @@ func updateAllColor() {
|
||||
updateNonConfigColor()
|
||||
}
|
||||
|
||||
// update title and option
|
||||
// Update title and option
|
||||
func updateTitle() {
|
||||
srcBox.SetTitle(translator.srcLang)
|
||||
dstBox.SetTitle(translator.dstLang)
|
||||
@ -239,7 +239,7 @@ func translatePageHandler(event *tcell.EventKey) *tcell.EventKey {
|
||||
}
|
||||
dstBox.SetText(src_text)
|
||||
case tcell.KeyCtrlO:
|
||||
// play source sound
|
||||
// Play source sound
|
||||
if translator.soundLock.Available() {
|
||||
message := srcBox.GetText()
|
||||
if len(message) > 0 {
|
||||
@ -254,7 +254,7 @@ func translatePageHandler(event *tcell.EventKey) *tcell.EventKey {
|
||||
|
||||
}
|
||||
case tcell.KeyCtrlP:
|
||||
// play destination sound
|
||||
// Play destination sound
|
||||
if translator.soundLock.Available() {
|
||||
message := dstBox.GetText(false)
|
||||
if len(message) > 0 {
|
||||
@ -268,7 +268,7 @@ func translatePageHandler(event *tcell.EventKey) *tcell.EventKey {
|
||||
}
|
||||
}
|
||||
case tcell.KeyCtrlX:
|
||||
// stop play sound
|
||||
// Stop play sound
|
||||
translator.soundLock.stop = true
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user