aboutsummaryrefslogtreecommitdiffstats
path: root/src/Plugin
diff options
context:
space:
mode:
authorTeddy Wing2017-08-19 09:29:08 +0200
committerTeddy Wing2017-08-19 09:29:08 +0200
commitabbe2141c56aaab9cf8b4913803c66096728ac16 (patch)
tree95689266bad0580296d8ef1dec229f06fe0010e7 /src/Plugin
parent6cd279630923cdcd053e373b56b8bc0ad85a9b08 (diff)
downloadsorbot-abbe2141c56aaab9cf8b4913803c66096728ac16.tar.bz2
Try to get I18n working
An unsuccessful attempt at getting i18n working through Shakespeare. Had a little help from: https://gist.github.com/nicolashery/f87467fb37da2b00cec1eed028f51e60 Unfortunately, I can't figure out how to get this working. Even before, without the locale stuff and defining a custom `translate` function, when I tried using Shakespeare's `_{}` function, I was, and still am, getting this error: src/Plugin/GitHubCommit.hs:38:29: error: Data constructor not in scope: MsgGitHubCommitRepoURLNotFound Yes, obviously, that makes sense. But how do I get it to be in scope if it isn't even in my code? What? I'm giving up on Shakespeare for i18n. It was a nice idea, I liked the fact that strings were stored in external files, but I don't know how to do this, I can't find the right resources online to use this in a non-web non-template context, and it's becoming a pain. Going to get rid of all this code and just use regular Haskell data types to do it as described in https://wiki.haskell.org/Internationalization_of_Haskell_programs
Diffstat (limited to 'src/Plugin')
-rw-r--r--src/Plugin/GitHubCommit.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Plugin/GitHubCommit.hs b/src/Plugin/GitHubCommit.hs
index a857604..23de2fa 100644
--- a/src/Plugin/GitHubCommit.hs
+++ b/src/Plugin/GitHubCommit.hs
@@ -33,8 +33,9 @@ gitHubCommitAction message = do
return $ respond rs
where
respond [] =
- Left "I couldn't find a repo URL for this channel. \
- \Try `git remote set origin REPO_URL`."
+ -- Left "I couldn't find a repo URL for this channel. \
+ -- \Try `git remote set origin REPO_URL`."
+ Left $ translate EN MsgGitHubCommitRepoURLNotFound
respond ((RepoUrlRow r):_) =
Right $ r `T.append` "/commits/" `T.append` T.pack (
M.textStr message =~ matchRegex gitHubCommit)