Added logging, because of problems in downstream project.

This commit is contained in:
simon 2017-08-08 15:02:32 +01:00
parent 734547d81a
commit 16b00810d0
2 changed files with 15 additions and 11 deletions

View file

@ -4,4 +4,5 @@
:license {:name "Eclipse Public License" :license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"} :url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"] :dependencies [[org.clojure/clojure "1.7.0"]
[com.taoensso/timbre "4.10.0"]
[instaparse "1.4.7"]]) [instaparse "1.4.7"]])

View file

@ -3,7 +3,8 @@
scot.weft.i18n.core scot.weft.i18n.core
(:require [clojure.string :as cs] (:require [clojure.string :as cs]
[clojure.java.io :as io] [clojure.java.io :as io]
[instaparse.core :as insta])) [instaparse.core :as insta]
[taoensso.timbre :as timbre]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; ;;;;
@ -132,16 +133,18 @@
Returns a map of message keys to strings." Returns a map of message keys to strings."
[accept-language-header resource-path default-locale] [accept-language-header resource-path default-locale]
(read-string (let [file-path (first
(slurp
(or
(first
(remove (remove
nil? nil?
(map (map
#(find-language-file-name % resource-path) #(find-language-file-name % resource-path)
(acceptable-languages accept-language-header)))) (acceptable-languages accept-language-header))))]
(str resource-path default-locale ".edn"))))) (timbre/debug (str "Found i18n file at '" file-path "'"))
(read-string
(slurp
(or
file-path
(str resource-path default-locale ".edn"))))))
(def get-messages (def get-messages