From 6cd279630923cdcd053e373b56b8bc0ad85a9b08 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 19 Aug 2017 02:10:38 +0200 Subject: Set up i18n en.msg: * Remove comment lines because apparently comments aren't allowed by the parser * Change data type to `T.Text` to match the import from the `I18n` module GitHubCommit.hs: Import the `I18n` module because we'll be testing it in context in a bit, but for now just want to get the module code to compile. I18n.hs: Follow the example on http://www.yesodweb.com/book/internationalization to make a function for proper internationalisation. --- src/I18n.hs | 13 +++++++++++++ src/Plugin/GitHubCommit.hs | 1 + 2 files changed, 14 insertions(+) create mode 100644 src/I18n.hs (limited to 'src') diff --git a/src/I18n.hs b/src/I18n.hs new file mode 100644 index 0000000..9b9f870 --- /dev/null +++ b/src/I18n.hs @@ -0,0 +1,13 @@ +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TemplateHaskell #-} + +module I18n where + +import qualified Data.Text as T + +import Text.Shakespeare.I18N (mkMessage, renderMessage) + +data Bot = Bot + +mkMessage "Bot" "messages" "en" diff --git a/src/Plugin/GitHubCommit.hs b/src/Plugin/GitHubCommit.hs index 187f016..a857604 100644 --- a/src/Plugin/GitHubCommit.hs +++ b/src/Plugin/GitHubCommit.hs @@ -10,6 +10,7 @@ import Database.SQLite.Simple import Database.SQLite.Simple.FromRow import Text.Regex.TDFA +import I18n import qualified Message as M import Plugin.Base -- cgit v1.2.3