From 75c7b2391ef32fab00477a24c259f3772fcc57f5 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 19 Nov 2017 19:41:25 +0100 Subject: Lib: Test help output with FR locale Check that translation and the `ReaderT` really do work by changing localisation of the STDOUT "help" output from `EN` to `FR`. To actually test this, add a french translation of the `GitHubCommit` plugin description. This string is successfully output by the "help" plugin. --- src/I18n.hs | 4 ++-- src/Lib.hs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/I18n.hs b/src/I18n.hs index e587648..884d459 100644 --- a/src/I18n.hs +++ b/src/I18n.hs @@ -24,8 +24,8 @@ 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 GitHubCommitDescription = "Générer un URL de commit à partir \ + \d'un 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) = diff --git a/src/Lib.hs b/src/Lib.hs index 821a49b..1d831ce 100644 --- a/src/Lib.hs +++ b/src/Lib.hs @@ -17,7 +17,7 @@ import PluginList as PL (plugins) import Control.Monad.Reader (runReaderT) import CliOptions (Options(..)) import Plugin.Help as Help (help) -import I18n (Locale(EN)) +import I18n (Locale(EN, FR)) import Plugin (performPlugin) import qualified Data.Text.IO as TIO @@ -42,7 +42,7 @@ someFunc = do })) Options { slackApiToken = "booya" - , language = EN + , language = FR } case hilp of Left x -> TIO.putStrLn x -- cgit v1.2.3