From 9c777bd1f6e9d5ba456f3f5db0986b3eb71d9fce Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 19 Aug 2017 10:43:17 +0200 Subject: I18n.hs: Implement custom i18n using Haskell data types Follow the example https://wiki.haskell.org/Internationalization_of_Haskell_programs_using_Haskell_data_types to get i18n. Get rid of the Shakespeare-I18N code. The idea of using text files to define translation strings was nice, but since I couldn't get it working with ease and couldn't find examples outside of a Yesod context, I decided to chuck it and go with the alternative, simpler approach. Really liking this system. Simplified things a bit from the example since we only need to show one language at a time. Will need to figure out how to use the same language throughout the program. --- src/Plugin/GitHubCommit.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Plugin/GitHubCommit.hs') diff --git a/src/Plugin/GitHubCommit.hs b/src/Plugin/GitHubCommit.hs index 23de2fa..8b43b57 100644 --- a/src/Plugin/GitHubCommit.hs +++ b/src/Plugin/GitHubCommit.hs @@ -33,9 +33,7 @@ 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 $ translate EN MsgGitHubCommitRepoURLNotFound + Left $ translate EN GitHubCommitRepoURLNotFound respond ((RepoUrlRow r):_) = Right $ r `T.append` "/commits/" `T.append` T.pack ( M.textStr message =~ matchRegex gitHubCommit) -- cgit v1.2.3