{-# LANGUAGE OverloadedStrings #-}
module Messages(l, Message(..)) where
import Text.Blaze.Html5 as H
import Text.Blaze.Html5.Attributes as A
import Text.Blaze.Html
import Data.Text (Text)
data Message =
AmphiaraoIntro |
CreateSession |
CloseSession |
LoadTimeout |
SessionNotFound |
NoResults |
PromptPreview |
ErrURL deriving Show
l :: [Text] -> Message -> Html
---- Begin localizations
l ("en":_) AmphiaraoIntro = do
h1 "Amphiarao webpage debugger for Rhapsode"
p $ do
text "Amphiarao lets you analyze how webpages are parsed & styled in "
a ! href "https://rhapsode.adrian.geek.nz/" $ "Rhapsode"
text ", either programmatically via "
a ! href "https://www.selenium.dev/" $ "Selenium"
text " (using "
a ! href "/webdriver/v1/" $ "this WebDriver endpoint"
text ") or manually via this web UI which can be viewed in any web browser including Rhapsode. "
p "Amphiarao is a locally-run webservice implemented using the same underlying libraries as Rhapsode."
l ("en":_) CreateSession = "Open new test session"
l ("en":_) LoadTimeout = "Load Timeout"
l ("en":_) CloseSession = "Close Session"
l ("en":_) SessionNotFound = "Session Not Found"
l ("en":_) NoResults = em "No Results"
l ("en":_) PromptPreview = em "Click a search result to preview it here"
l ("en":_) ErrURL = do
h1 "Invalid Link!"
p "The provided URL was not absolute."
---- End localizations
l (_:langs) msg = l langs msg
l [] msg = string $ show msg