From 6f3817022ace80ac3dbc92253b2fb1ed18f519e1 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Fri, 8 Sep 2017 15:51:02 +0100 Subject: [PATCH 1/4] All tests pass again! Two separate silly bugs. --- src/scot/weft/i18n/core.clj | 13 +++++++------ test/scot/weft/i18n/test/core.clj | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/scot/weft/i18n/core.clj b/src/scot/weft/i18n/core.clj index 479d554..0a0e4ce 100644 --- a/src/scot/weft/i18n/core.clj +++ b/src/scot/weft/i18n/core.clj @@ -160,12 +160,13 @@ (acceptable-languages accept-language-header))))] (timbre/debug (str "Found i18n file at '" file-path "'")) (try - (slurp-resource - (or - file-path - (join java.io.File/separator - [resource-path - (str default-locale ".edn")]))) + (read-string + (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 49621de..8992988 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" "resources/i18n" "en-GB")))) + (:pipe (get-messages "en-GB, fr-FR;q=0.9" "i18n" "en-GB")))) (is (= "Ceci n'est pas une pipe." - (:pipe (get-messages "en-GB;q=0.9, fr-FR" "resources/i18n" "en-GB")))) + (:pipe (get-messages "en-GB;q=0.9, fr-FR" "i18n" "en-GB")))) (is - (= nil (get-messages "xx-XX;q=0.5, yy-YY" "resources/i18n" "zz-ZZ")) + (= nil (get-messages "xx-XX;q=0.5, yy-YY" "i18n" "zz-ZZ")) "If no usable file is found, an exception should not be thrown."))) From c31a3548d4c41aaad5c06011f6c1c0fd181cef8a Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Fri, 8 Sep 2017 15:51:02 +0100 Subject: [PATCH 2/4] 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."))) From e6d45a149e76ceda0b72980fc6cb0c26d4bedd07 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Wed, 4 Jan 2023 20:54:47 +0000 Subject: [PATCH 3/4] Removed `-SNAPSHOT` from version id. --- README.md | 2 +- doc/intro.md | 2 +- project.clj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 309c761..834e736 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A Clojure library designed to provide simple interationalisation of user-facing To use this library in your project, add the following leiningen dependency: - [org.clojars.simon_brooke/internationalisation "1.0.4"] + [org.clojars.simon_brooke/internationalisation "1.0.3"] To use it in your namespace, require: diff --git a/doc/intro.md b/doc/intro.md index 309c761..834e736 100644 --- a/doc/intro.md +++ b/doc/intro.md @@ -6,7 +6,7 @@ A Clojure library designed to provide simple interationalisation of user-facing To use this library in your project, add the following leiningen dependency: - [org.clojars.simon_brooke/internationalisation "1.0.4"] + [org.clojars.simon_brooke/internationalisation "1.0.3"] To use it in your namespace, require: diff --git a/project.clj b/project.clj index eaaf7a1..b57247d 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.clojars.simon_brooke/internationalisation "1.0.3-SNAPSHOT" +(defproject org.clojars.simon_brooke/internationalisation "1.0.3" :cloverage {:output "docs/cloverage" :codecov? true :emma-xml? true} From 9413fa6a4c19735fd7b2052e959b45d3283774c9 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Wed, 4 Jan 2023 21:02:57 +0000 Subject: [PATCH 4/4] Upversioned to 1.0.4 I've clearly messed up: I've already deployed a 1.0.3. Careless! --- README.md | 2 +- doc/intro.md | 2 +- project.clj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 834e736..309c761 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A Clojure library designed to provide simple interationalisation of user-facing To use this library in your project, add the following leiningen dependency: - [org.clojars.simon_brooke/internationalisation "1.0.3"] + [org.clojars.simon_brooke/internationalisation "1.0.4"] To use it in your namespace, require: diff --git a/doc/intro.md b/doc/intro.md index 834e736..309c761 100644 --- a/doc/intro.md +++ b/doc/intro.md @@ -6,7 +6,7 @@ A Clojure library designed to provide simple interationalisation of user-facing To use this library in your project, add the following leiningen dependency: - [org.clojars.simon_brooke/internationalisation "1.0.3"] + [org.clojars.simon_brooke/internationalisation "1.0.4"] To use it in your namespace, require: diff --git a/project.clj b/project.clj index b57247d..0053280 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject org.clojars.simon_brooke/internationalisation "1.0.3" +(defproject org.clojars.simon_brooke/internationalisation "1.0.4" :cloverage {:output "docs/cloverage" :codecov? true :emma-xml? true}