diff options
author | Teddy Wing | 2017-09-11 00:39:40 +0200 |
---|---|---|
committer | Teddy Wing | 2017-09-13 04:46:26 +0200 |
commit | 613e0d9a67d29b2bb27efd7ca993d4108724b30a (patch) | |
tree | 35b0c86ca986d2526676a74e96e8a1a82e16a4c0 /src/I18n.hs | |
parent | 8e0f025188e55b7463707205174c54cbbf8255d3 (diff) | |
download | sorbot-613e0d9a67d29b2bb27efd7ca993d4108724b30a.tar.bz2 |
GitHubCommit: Try to add `Bot` monad
This is an attempt at wrapping the functions in this plugin with the new
`Bot` monad. It didn't go very well.
These changes are the result of some initial code and then a lot of
fiddling to try to resolve compiler errors, many of which are still
present.
The ultimate goal is to be able to wrap the functions in `Bot` so that
we can use the language configuration option to determine which
translation to use.
Thanks to 'dmwit' on Freenode#haskell for looking at my code and giving
me suggestions for my type errors.
Diffstat (limited to 'src/I18n.hs')
-rw-r--r-- | src/I18n.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/I18n.hs b/src/I18n.hs index f7a4571..e587648 100644 --- a/src/I18n.hs +++ b/src/I18n.hs @@ -12,16 +12,20 @@ import qualified Data.Text as T data Locale = EN | FR deriving (Show) data Message - = GitHubCommitRepoURLNotFound + = GitHubCommitDescription + | GitHubCommitRepoURLNotFound | GitRemoteSetOriginUpdatedRepoURL T.Text translate_en_US :: Message -> T.Text +translate_en_US GitHubCommitDescription = "Generate a commit URL based on the given SHA." translate_en_US GitHubCommitRepoURLNotFound = "I couldn't find a repo URL for \ \this channel. Try `git remote set origin REPO_URL`." translate_en_US (GitRemoteSetOriginUpdatedRepoURL url) = "I updated the channel's repo URL to '" `T.append` url `T.append` "'." translate_fr_FR :: Message -> T.Text +-- TODO: translate +translate_fr_FR GitHubCommitDescription = "Generate a commit URL based on the given SHA." translate_fr_FR GitHubCommitRepoURLNotFound = "Je n'ai pas trouvé une URL de \ \repo pour ce channel. Essaye `git remote set origin REPO_URL`." translate_fr_FR (GitRemoteSetOriginUpdatedRepoURL url) = |