aboutsummaryrefslogtreecommitdiff
path: root/src/Model/Translation/Message.hs
diff options
context:
space:
mode:
authorJoris Guyonvarch2014-04-06 22:55:16 +0200
committerJoris2019-05-01 15:34:22 +0200
commit0fe906ae7453aa684e998bbcc7a78b62d84f0206 (patch)
treed3968af830b964193349187fb6fc583780cd0ce3 /src/Model/Translation/Message.hs
parent8b11c4be2b3ac354fa14534662dbd92374617a3e (diff)
Show resume and projects from a configuration file
Diffstat (limited to 'src/Model/Translation/Message.hs')
-rw-r--r--src/Model/Translation/Message.hs90
1 files changed, 90 insertions, 0 deletions
diff --git a/src/Model/Translation/Message.hs b/src/Model/Translation/Message.hs
new file mode 100644
index 0000000..c9e0fcb
--- /dev/null
+++ b/src/Model/Translation/Message.hs
@@ -0,0 +1,90 @@
+module Model.Translation.Message
+ ( getMessage
+ ) where
+
+import Model.Translation.Language
+import Model.Translation.Key
+
+getMessage :: Key -> Language -> String
+
+getMessage Home English = "home"
+getMessage Home French = "accueil"
+
+getMessage Resume English = "resume"
+getMessage Resume French = "curriculum"
+
+getMessage Projects English = "projects"
+getMessage Projects French = "projets"
+
+getMessage Contact English = "contact"
+getMessage Contact French = "contact"
+
+getMessage Experience English = "experience"
+getMessage Experience French = "expérience"
+
+getMessage EducationalBackground English = "educational background"
+getMessage EducationalBackground French = "études"
+
+getMessage Skills English = "skills"
+getMessage Skills French = "compétences"
+
+getMessage Interests English = "interests"
+getMessage Interests French = "intérêts"
+
+getMessage Since English = "since"
+getMessage Since French = "depuis"
+
+getMessage From English = "from"
+getMessage From French = "de"
+
+getMessage To English = "to"
+getMessage To French = "à"
+
+getMessage And English = "and"
+getMessage And French = "et"
+
+getMessage (Month m) English =
+ case m of
+ 1 -> "january"
+ 2 -> "february"
+ 3 -> "march"
+ 4 -> "april"
+ 5 -> "may"
+ 6 -> "june"
+ 7 -> "july"
+ 8 -> "august"
+ 9 -> "september"
+ 10 -> "october"
+ 11 -> "november"
+ 12 -> "december"
+ _ -> ""
+getMessage (Month m) French =
+ case m of
+ 1 -> "janvier"
+ 2 -> "février"
+ 3 -> "mars"
+ 4 -> "avril"
+ 5 -> "mai"
+ 6 -> "juin"
+ 7 -> "juillet"
+ 8 -> "août"
+ 9 -> "septembre"
+ 10 -> "octoble"
+ 11 -> "novembre"
+ 12 -> "décembre"
+ _ -> ""
+
+getMessage (MonthText count) English = "month" ++ (plural count)
+getMessage (MonthText _) French = "mois"
+
+getMessage (YearText count) English = "year" ++ (plural count)
+getMessage (YearText count) French = "an" ++ (plural count)
+
+getMessage TryIt English = "Try it!"
+getMessage TryIt French = "Voir"
+
+getMessage PageNotFound English = "Page not found."
+getMessage PageNotFound French = "La page que vous recherchez n'est pas disponible."
+
+plural :: Int -> String
+plural count = if count > 1 then "s" else ""