From c31a3548d4c41aaad5c06011f6c1c0fd181cef8a Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Fri, 8 Sep 2017 15:51:02 +0100 Subject: [PATCH] Revert "All tests pass again! Two separate silly bugs." This reverts commit 6f3817022ace80ac3dbc92253b2fb1ed18f519e1. --- src/scot/weft/i18n/core.clj | 13 ++++++------- test/scot/weft/i18n/test/core.clj | 6 +++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/scot/weft/i18n/core.clj b/src/scot/weft/i18n/core.clj index 0a0e4ce..479d554 100644 --- a/src/scot/weft/i18n/core.clj +++ b/src/scot/weft/i18n/core.clj @@ -160,13 +160,12 @@ (acceptable-languages accept-language-header))))] (timbre/debug (str "Found i18n file at '" file-path "'")) (try - (read-string - (slurp-resource - (or - file-path - (join java.io.File/separator - [resource-path - (str default-locale ".edn")])))) + (slurp-resource + (or + file-path + (join java.io.File/separator + [resource-path + (str default-locale ".edn")]))) (catch Exception any (timbre/error (str "Failed to load internationalisation because " (.getMessage any))) nil)))) diff --git a/test/scot/weft/i18n/test/core.clj b/test/scot/weft/i18n/test/core.clj index 8992988..49621de 100644 --- a/test/scot/weft/i18n/test/core.clj +++ b/test/scot/weft/i18n/test/core.clj @@ -199,11 +199,11 @@ (is (= "This is not a pipe" - (:pipe (get-messages "en-GB, fr-FR;q=0.9" "i18n" "en-GB")))) + (:pipe (get-messages "en-GB, fr-FR;q=0.9" "resources/i18n" "en-GB")))) (is (= "Ceci n'est pas une pipe." - (:pipe (get-messages "en-GB;q=0.9, fr-FR" "i18n" "en-GB")))) + (:pipe (get-messages "en-GB;q=0.9, fr-FR" "resources/i18n" "en-GB")))) (is - (= nil (get-messages "xx-XX;q=0.5, yy-YY" "i18n" "zz-ZZ")) + (= nil (get-messages "xx-XX;q=0.5, yy-YY" "resources/i18n" "zz-ZZ")) "If no usable file is found, an exception should not be thrown.")))