{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}

module BtcLsp.Yesod.Handler.Language where

import qualified BtcLsp.Yesod.Data.Language as Lang
import BtcLsp.Yesod.Import

getLanguageR :: Lang.Code -> Handler ()
getLanguageR :: Code -> Handler ()
getLanguageR Code
language = do
  Text -> Handler ()
forall (m :: * -> *). MonadHandler m => Text -> m ()
setLanguage (Text -> Handler ()) -> Text -> Handler ()
forall a b. (a -> b) -> a -> b
$ Code -> Text
forall s. PathPiece s => s -> Text
toPathPiece Code
language
  Handler ()
forall (m :: * -> *). MonadHandler m => m ()
setUltDestReferer
  Route App -> Handler ()
forall (m :: * -> *) url a.
(RedirectUrl (HandlerSite m) url, MonadHandler m) =>
url -> m a
redirectUltDest Route App
HomeR