Documentation ¶
Overview ¶
Copyright 2014 Kaissersoft Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This package is to help all gophers out there to translate texts with google translate for free, hope it helps a lot of people
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QuickTranslate ¶
QuickTranslate translates a single text given to langs with auto detecting from language
Types ¶
type Translator ¶
type Translator struct {
// contains filtered or unexported fields
}
Translator is a struct that contains an origin Lang and a result Lang and saves history of the queries made
func New ¶
func New(from, to language.Tag) (*Translator, error)
New returns a Translator struct to ease translation operations need a source Lang and a target Lang
func (*Translator) QueryHistory ¶
func (t *Translator) QueryHistory() []string
QueryHistory returns all strings submitted to Translator
func (*Translator) ResultsHistory ¶
func (t *Translator) ResultsHistory() []string
ResultsHistory returns all strings obtained from Translator.Translate
func (*Translator) Translate ¶
func (t *Translator) Translate(text string) string
Translate takes a string and make the translation over the created Struct