diff options
Diffstat (limited to 'translate.go')
| -rw-r--r-- | translate.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/translate.go b/translate.go index 66cee26..508e5db 100644 --- a/translate.go +++ b/translate.go @@ -115,6 +115,9 @@ func (t *translator) run() { } } +// translateText is the synchronous form, used when a sentence is kept for the log. +func (t *translator) translateText(text string) (string, error) { return t.translate(text) } + func (t *translator) translate(text string) (string, error) { ctx, cancel := context.WithTimeout(context.Background(), 8*time.Second) defer cancel() |
