diff --git a/Text/Shakespeare/I18N.hs b/Text/Shakespeare/I18N.hs
--- a/Text/Shakespeare/I18N.hs
+++ b/Text/Shakespeare/I18N.hs
@@ -312,7 +312,7 @@
             let lang = pack $ reverse $ drop 4 $ reverse file
             bs <- S.readFile file'
             let s = unpack $ decodeUtf8 bs
-            defs <- fmap catMaybes $ mapM parseDef $ lines s
+            defs <- fmap catMaybes $ mapM (parseDef . T.unpack . T.strip . T.pack) $ lines s
             return $ Just (file', (lang, defs))
         else return Nothing
 
diff --git a/shakespeare-i18n.cabal b/shakespeare-i18n.cabal
--- a/shakespeare-i18n.cabal
+++ b/shakespeare-i18n.cabal
@@ -1,5 +1,5 @@
 name:            shakespeare-i18n
-version:         1.0.0.2
+version:         1.0.0.3
 license:         MIT
 license-file:    LICENSE
 author:          Michael Snoyman <michael@snoyman.com>
@@ -15,6 +15,7 @@
 cabal-version:   >= 1.8
 build-type:      Simple
 homepage:        http://www.yesodweb.com/book/shakespearean-templates
+extra-source-files: test-messages/*.msg
 
 library
     build-depends:   base             >= 4       && < 5
@@ -29,6 +30,18 @@
     ghc-options:     -Wall
     if impl(ghc >= 7.4)
        cpp-options: -DGHC_7_4
+
+test-suite test
+    hs-source-dirs: test
+    main-is: Spec.hs
+    other-modules: Text.Shakespeare.I18NSpec
+    type: exitcode-stdio-1.0
+
+    ghc-options:   -Wall
+    build-depends: base
+                 , shakespeare-i18n
+                 , hspec >= 1.4
+                 , text
 
 source-repository head
   type:     git
diff --git a/test-messages/en.msg b/test-messages/en.msg
new file mode 100644
--- /dev/null
+++ b/test-messages/en.msg
@@ -0,0 +1,29 @@
+NotAnAdmin: You must be an administrator to access this page.
+
+WelcomeHomepage: Welcome to the homepage
+SeeArchive: See the archive
+
+NoEntries: There are no entries in the blog
+LoginToPost: Admins can login to post
+NewEntry: Post to blog
+NewEntryTitle: Title
+NewEntryContent: Content
+
+PleaseCorrectEntry: Your submitted entry had some errors, please correct and try again.
+EntryCreated title@Text: Your new blog post, #{title}, has been created
+
+EntryTitle title@Text: Blog post: #{title}
+CommentsHeading: Comments
+NoComments: There are no comments
+AddCommentHeading: Add a Comment
+LoginToComment: You must be logged in to comment
+AddCommentButton: Add comment
+
+CommentName: Your display name
+CommentText: Comment
+CommentAdded: Your comment has been added
+PleaseCorrectComment: Your submitted comment had some errors, please correct and try again.
+
+HomepageTitle: Yesod Blog Demo
+BlogArchiveTitle: Blog Archive
+
diff --git a/test/Spec.hs b/test/Spec.hs
new file mode 100644
--- /dev/null
+++ b/test/Spec.hs
@@ -0,0 +1,1 @@
+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
diff --git a/test/Text/Shakespeare/I18NSpec.hs b/test/Text/Shakespeare/I18NSpec.hs
new file mode 100644
--- /dev/null
+++ b/test/Text/Shakespeare/I18NSpec.hs
@@ -0,0 +1,16 @@
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE OverloadedStrings     #-}
+{-# LANGUAGE TemplateHaskell       #-}
+module Text.Shakespeare.I18NSpec
+    ( spec
+    ) where
+
+import           Data.Text             (Text)
+import           Text.Shakespeare.I18N
+
+spec :: Monad m => m ()
+spec = return ()
+
+data Test = Test
+
+mkMessage "Test" "test-messages" "en"
