Index: trunk/engines/engine.go
===================================================================
--- trunk/engines/engine.go	(revision 19)
+++ trunk/engines/engine.go	(revision 20)
@@ -13,4 +13,5 @@
 	Translate(text string, from, to string) (TranslationResult, error)
 	DetectLanguage(text string) (string, error)
+	Tts(text, lang string) (string, error)
 }
 
@@ -18,7 +19,7 @@
 
 var Engines = map[string]Engine{
-	"google":   &GoogleTranslate{},
-	"icibia":   &ICIBA{},
-	"libre":    &LibreTranslate{},
+	"google": &GoogleTranslate{},
+	// "icibia":   &ICIBA{},
+	// "libre":    &LibreTranslate{},
 	"reverseo": &Reverso{},
 }
Index: trunk/engines/google.go
===================================================================
--- trunk/engines/google.go	(revision 19)
+++ trunk/engines/google.go	(revision 20)
@@ -36,5 +36,4 @@
 
 	response, err := http.Get(requestURL.String())
-
 	if err != nil {
 		return nil, err
@@ -44,10 +43,9 @@
 
 	doc, err := goquery.NewDocumentFromReader(response.Body)
-
 	if err != nil {
 		return nil, err
 	}
 
-	var langs Language
+	var langs Language = make(Language)
 
 	doc.Find(".language-item").Each(func(_ int, s *goquery.Selection) {
@@ -55,6 +53,4 @@
 
 		href, exists := a.Attr("href")
-
-		// Shouldn't happen, but here goes.
 		if !exists {
 			return
@@ -62,5 +58,4 @@
 
 		langURL, err := url.Parse(href)
-
 		if err != nil {
 			return
@@ -68,8 +63,4 @@
 
 		langCode := langURL.Query()[langsType][0]
-
-		if langCode == "auto" {
-			return
-		}
 
 		langs[langCode] = a.Text()
@@ -85,4 +76,16 @@
 func (e *GoogleTranslate) TargetLanguages() (Language, error) {
 	return e.getLangs("target")
+}
+
+func (e *GoogleTranslate) Tts(text, lang string) (string, error) {
+	requestURL, _ := url.Parse("https://translate.google.com/translate_tts")
+
+	query := url.Values{}
+	query.Add("tl", lang)
+	query.Add("q", text)
+	query.Add("client", "tw-ob")
+	requestURL.RawQuery = query.Encode()
+
+	return requestURL.String(), nil
 }
 
Index: trunk/engines/iciba.go
===================================================================
--- trunk/engines/iciba.go	(revision 19)
+++ trunk/engines/iciba.go	(revision 20)
@@ -226,10 +226,5 @@
 
 func (_ *ICIBA) Translate(text string, from, to string) (TranslationResult, error) {
-	requestURL, err := url.Parse("https://ifanyi.iciba.com/index.php")
-
-	if err != nil {
-		// The URL is constant, so it should never fail.
-		panic(err)
-	}
+	requestURL, _ := url.Parse("https://ifanyi.iciba.com/index.php")
 
 	query := url.Values{}
@@ -240,5 +235,4 @@
 
 	sum := md5.Sum([]byte(("6key_web_fanyiifanyiweb8hc9s98e" + text)))
-
 	query.Add("sign", hex.EncodeToString(sum[:])[:16])
 
@@ -251,5 +245,4 @@
 
 	response, err := http.PostForm(requestURL.String(), formData)
-
 	if err != nil {
 		return TranslationResult{}, err
@@ -287,2 +280,4 @@
 	}, nil
 }
+
+func (_ *ICIBA) Tts(text, lang string) (string, error) { return "", nil }
Index: trunk/engines/libretranslate.go
===================================================================
--- trunk/engines/libretranslate.go	(revision 19)
+++ trunk/engines/libretranslate.go	(revision 20)
@@ -63,4 +63,6 @@
 
 func (e *LibreTranslate) TargetLanguages() (Language, error) { return e.getLangs() }
+
+func (e *LibreTranslate) Tts(text, lang string) (string, error) { return "", nil }
 
 type libreDetectResponse []struct {
Index: trunk/engines/reverso.go
===================================================================
--- trunk/engines/reverso.go	(revision 19)
+++ trunk/engines/reverso.go	(revision 20)
@@ -46,4 +46,6 @@
 
 func (_ *Reverso) TargetLanguages() (Language, error) { return reversoLangs, nil }
+
+func (_ *Reverso) Tts(text, lang string) (string, error) { return "", nil }
 
 type reversoAPIResponse struct {
Index: trunk/web/main.go
===================================================================
--- trunk/web/main.go	(revision 19)
+++ trunk/web/main.go	(revision 20)
@@ -91,6 +91,6 @@
 			"Engine":          engine,
 			"enginesNames":    enginesNames,
-			"SourceLanguages": targetLanguages,
-			"TargetLanguages": sourceLanguages,
+			"SourceLanguages": sourceLanguages,
+			"TargetLanguages": targetLanguages,
 			"OriginalText":    originalText,
 			"TranslatedText":  translatedText,
@@ -169,7 +169,4 @@
 
 		lang := c.Query("lang")
-		if lang == "" {
-			lang = "en"
-		}
 
 		if url, err := engines.Engines[engine].Tts(text, lang); err != nil {
@@ -189,4 +186,22 @@
 	})
 
+	app.Post("/switchlanguages", func(c *fiber.Ctx) error {
+		if c.Cookies("from") != "" {
+			fromCookie := new(fiber.Cookie)
+			fromCookie.Name = "from"
+			fromCookie.Value = c.Cookies("to")
+			fromCookie.Expires = time.Now().Add(24 * time.Hour * 365)
+
+			toCookie := new(fiber.Cookie)
+			toCookie.Name = "to"
+			toCookie.Value = c.Cookies("from")
+			toCookie.Expires = time.Now().Add(24 * time.Hour * 365)
+
+			c.Cookie(fromCookie)
+			c.Cookie(toCookie)
+		}
+		return c.Redirect("/")
+	})
+
 	app.Static("/static", "./static")
 
Index: trunk/web/views/index.html
===================================================================
--- trunk/web/views/index.html	(revision 19)
+++ trunk/web/views/index.html	(revision 20)
@@ -58,9 +58,9 @@
                 <textarea autofocus class="item" id="input" name="text" dir="auto"
                     placeholder="Enter Text Here">{{ .OriginalText }}</textarea>
-                <div class="center">
-                    <audio controls>
-                        <source type="audio/mpeg" src="{{ .TtsFrom }}">
-                    </audio>
-                </div>
+                {{if .TtsFrom}}
+                <audio controls>
+                    <source type="audio/mpeg" src="{{ .TtsFrom }}">
+                </audio>
+                {{end}}
             </div>
 
@@ -68,7 +68,9 @@
                 <textarea id="output" class="translation item" dir="auto" placeholder="Translation"
                     readonly>{{.TranslatedText}}</textarea>
+                {{if .TtsTo}}
                 <audio controls>
                     <source type="audio/mpeg" src="{{ .TtsTo }}">
                 </audio>
+                {{end}}
             </div>
         </div>
