Skip to content
Snippets Groups Projects
Verified Commit d9d6ac36 authored by jan.hamal.dvorak's avatar jan.hamal.dvorak
Browse files

Add a localization example to the docs

parent 2440c87a
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,31 @@ Stability : unstable ...@@ -8,6 +8,31 @@ Stability : unstable
Portability : non-portable (ghc) Portability : non-portable (ghc)
This module provides support for website localization. This module provides support for website localization.
Example:
@
data SampleMessages
= MsgSuccess
| MsgFailure
instance 'ToHtml' SampleMessages where
toHtmlRaw = toHtml
toHtml MsgSuccess = \"Success\"
toHtml MsgFailure = \"Failure\"
instance Localized SampleMessages where
localize \"cs\" MsgSuccess = Just \"Úspěch\"
localize \"cs\" MsgFailure = Just \"Selhání\"
localize _locale _msg = Nothing
getSampleR :: Bool -> Action ()
getSampleR flag = do
'sendHTML' $ do
if flag
then lc_ MsgSuccess
else lc_ MsgFailure
@
-} -}
module Web.Hikaru.Locale module Web.Hikaru.Locale
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment