Index: trunk/web/main.go
===================================================================
--- trunk/web/main.go	(revision 17)
+++ trunk/web/main.go	(revision 18)
@@ -5,4 +5,5 @@
 	"net/http"
 	"net/url"
+	"time"
 
 	"codeberg.org/SimpleWeb/SimplyTranslate/engines"
@@ -15,4 +16,79 @@
 	app := fiber.New(fiber.Config{
 		Views: engine,
+	})
+
+	app.All("/", func(c *fiber.Ctx) error {
+		engine := c.Query("engine")
+		if _, ok := engines.Engines[engine]; !ok || engine == "" {
+			engine = "google"
+		}
+		targetLanguages, err := engines.Engines[engine].TargetLanguages()
+		if err != nil {
+			return c.SendStatus(500)
+		}
+		sourceLanguages, err := engines.Engines[engine].SourceLanguages()
+		if err != nil {
+			return c.SendStatus(500)
+		}
+		originalText := ""
+		translatedText := ""
+		from := ""
+		to := ""
+		ttsFrom := ""
+		ttsTo := ""
+
+		if c.Method() == "POST" {
+			from = c.FormValue("from")
+			to = c.FormValue("to")
+			originalText = c.FormValue("text")
+			if result, err := engines.Engines[engine].Translate(originalText, from, to); err != nil {
+				return c.SendStatus(500)
+			} else {
+				translatedText = result.TranslatedText
+			}
+
+			ttsFromURL, _ := url.Parse("api/tts")
+			fromQuery := url.Values{}
+			fromQuery.Add("lang", from)
+			fromQuery.Add("text", originalText)
+			ttsFromURL.RawQuery = fromQuery.Encode()
+			ttsFrom = ttsFromURL.String()
+
+			ttsToURL, _ := url.Parse("api/tts")
+			toQuery := url.Values{}
+			toQuery.Add("lang", to)
+			toQuery.Add("text", translatedText)
+			ttsToURL.RawQuery = toQuery.Encode()
+			ttsTo = ttsToURL.String()
+
+			fromCookie := new(fiber.Cookie)
+			fromCookie.Name = "from"
+			fromCookie.Value = from
+			fromCookie.Expires = time.Now().Add(24 * time.Hour * 365)
+			c.Cookie(fromCookie)
+
+			toCookie := new(fiber.Cookie)
+			toCookie.Name = "to"
+			toCookie.Value = to
+			toCookie.Expires = time.Now().Add(24 * time.Hour * 365)
+			c.Cookie(toCookie)
+
+		} else if c.Method() == "GET" {
+			from = c.Cookies("from")
+			to = c.Cookies("to")
+		} else {
+			return c.SendStatus(400)
+		}
+		return c.Render("index", fiber.Map{
+			"Engine":          engine,
+			"SourceLanguages": targetLanguages,
+			"TargetLanguages": sourceLanguages,
+			"OriginalText":    originalText,
+			"TranslatedText":  translatedText,
+			"From":            from,
+			"To":              to,
+			"TtsFrom":         ttsFrom,
+			"TtsTo":           ttsTo,
+		})
 	})
 
@@ -72,67 +148,4 @@
 	})
 
-	app.All("/", func(c *fiber.Ctx) error {
-		engine := c.Query("engine")
-		if _, ok := engines.Engines[engine]; !ok || engine == "" {
-			engine = "google"
-		}
-		targetLanguages, err := engines.Engines[engine].TargetLanguages()
-		if err != nil {
-			return c.SendStatus(500)
-		}
-		sourceLanguages, err := engines.Engines[engine].SourceLanguages()
-		if err != nil {
-			return c.SendStatus(500)
-		}
-		originalText := ""
-		translatedText := ""
-		from := ""
-		to := ""
-		ttsFrom := ""
-		ttsTo := ""
-
-		if c.Method() == "POST" {
-			from =
-				c.FormValue("from")
-			to = c.FormValue("to")
-			originalText = c.FormValue("text")
-			if result, err := engines.Engines[engine].Translate(originalText, from, to); err != nil {
-				return c.SendStatus(500)
-			} else {
-				translatedText = result.TranslatedText
-			}
-
-			ttsFromURL, _ := url.Parse("api/tts")
-
-			fromQuery := url.Values{}
-			fromQuery.Add("lang", from)
-			fromQuery.Add("text", originalText)
-			ttsFromURL.RawQuery = fromQuery.Encode()
-			ttsFrom = ttsFromURL.String()
-
-			ttsToURL, _ := url.Parse("api/tts")
-
-			toQuery := url.Values{}
-			toQuery.Add("lang", to)
-			toQuery.Add("text", translatedText)
-			ttsToURL.RawQuery = toQuery.Encode()
-			ttsTo = ttsToURL.String()
-
-		}
-		return c.Render("index", fiber.Map{
-			"Engine":          engine,
-			"SourceLanguages": targetLanguages,
-			"TargetLanguages": sourceLanguages,
-			"OriginalText":    originalText,
-			"TranslatedText":  translatedText,
-			"From":            from,
-			"To":              to,
-			"TtsFrom":         ttsFrom,
-			"TtsTo":           ttsTo,
-		})
-	})
-
-	app.Static("/static", "./static")
-
 	app.Get("/api/tts", func(c *fiber.Ctx) error {
 		engine := c.Query("engine")
@@ -164,5 +177,8 @@
 			}
 		}
+
 	})
+
+	app.Static("/static", "./static")
 
 	app.Listen(":3000")
Index: trunk/web/static/style.css
===================================================================
--- trunk/web/static/style.css	(revision 17)
+++ trunk/web/static/style.css	(revision 18)
@@ -29,4 +29,5 @@
     width: 450px;
     margin: 5px 10px;
+    gap: 10px;
 }
 
Index: trunk/web/views/index.html
===================================================================
--- trunk/web/views/index.html	(revision 17)
+++ trunk/web/views/index.html	(revision 18)
@@ -18,7 +18,5 @@
     </header>
 
-    <form method="POST" id="translation-form">
-
-        <input type="hidden" name="engine" value="{{.Engine}}">
+    <form action="/?engine={{.Engine}}" method="POST" id="translation-form">
 
         <div class="wrap languages">
