diff options
Diffstat (limited to 'src/Plugin')
| -rw-r--r-- | src/Plugin/GitHubCommit.hs | 15 | 
1 files changed, 11 insertions, 4 deletions
| diff --git a/src/Plugin/GitHubCommit.hs b/src/Plugin/GitHubCommit.hs index 3d2e490..b8ecf9e 100644 --- a/src/Plugin/GitHubCommit.hs +++ b/src/Plugin/GitHubCommit.hs @@ -12,6 +12,7 @@ import Text.Regex.TDFA  import I18n  import qualified Message as M +import CliOptions (Options(language), parseOptions)  import Plugin.Base  gitHubCommit = defaultPlugin @@ -32,14 +33,20 @@ gitHubCommitAction message = do          :: IO [RepoUrlRow]      close dbConn -    return $ respond rs +    opts <- parseOptions +    let lang = language opts + +    return $ respond rs lang    where -    respond [] = -        Left $ translate EN GitHubCommitRepoURLNotFound -    respond ((RepoUrlRow r):_) = +    respond [] lang = +        Left $ translate lang GitHubCommitRepoURLNotFound +    respond ((RepoUrlRow r):_) _ =          Right $ r `T.append` "/commits/" `T.append` T.pack (              M.textStr message =~ matchRegex gitHubCommit) +-- TODO +-- lang ::  +  type Id = Int  type RepoUrl = T.Text | 
