blob: f7a4571f1f74d827e11c859764383f4dd427941a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
{-# LANGUAGE OverloadedStrings #-}
module I18n
( Locale(..)
, Message(..)
, translate
) where
import qualified Data.Text as T
data Locale = EN | FR deriving (Show)
data Message
= GitHubCommitRepoURLNotFound
| GitRemoteSetOriginUpdatedRepoURL T.Text
translate_en_US :: Message -> T.Text
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
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) =
"J'ai mis à jour l'URL de repo pour ce channel ("
`T.append` url `T.append` ")."
translate :: Locale -> Message -> T.Text
translate EN = translate_en_US
translate FR = translate_fr_FR
|