Skip to content

Commit

Permalink
#25: Fix (awaiting tidy up)
Browse files Browse the repository at this point in the history
This is a fix, but it's a fix against the `develop` branch of [internationalisation](https://github.com/simon-brooke/internationalisation), so I need to do a new release of internationalisation before I call this a full fix.
  • Loading branch information
simon-brooke committed Sep 8, 2017
1 parent 335c2f2 commit fab37d5
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[org.clojure/core.memoize "0.5.9"]
[org.clojure/data.json "0.2.6"]
[org.clojure/tools.logging "0.4.0"]
[org.clojars.simon_brooke/internationalisation "1.0.1-SNAPSHOT"]
[org.clojars.simon_brooke/internationalisation "1.0.3-SNAPSHOT"]
[clj-jgit "0.8.9"]
[clj-yaml "0.4.0"]
[com.cemerick/url "0.1.1"]
Expand Down
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions src/smeagol/handler.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
:author "Simon Brooke"}
smeagol.handler
(:require [compojure.core :refer [defroutes]]
[smeagol.routes.wiki :refer [wiki-routes]]
[smeagol.middleware :refer [load-middleware]]
[smeagol.session-manager :as session-manager]
[compojure.route :as route]
[cronj.core :as cronj]
[environ.core :refer [env]]
[noir.response :refer [redirect]]
[noir.util.middleware :refer [app-handler]]
[noir.session :as session]
[noir.util.middleware :refer [app-handler]]
[ring.middleware.defaults :refer [site-defaults]]
[compojure.route :as route]
[taoensso.timbre :as timbre]
[taoensso.timbre.appenders.3rd-party.rotor :as rotor]
[selmer.parser :as parser]
[environ.core :refer [env]]
[cronj.core :as cronj]))
[smeagol.routes.wiki :refer [wiki-routes]]
[smeagol.middleware :refer [load-middleware]]
[smeagol.session-manager :as session-manager]
[taoensso.timbre :as timbre]
[taoensso.timbre.appenders.3rd-party.rotor :as rotor]))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
Expand Down
2 changes: 1 addition & 1 deletion src/smeagol/layout.clj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
(let [messages (:i18n context-map)
default (or (second args) (first args))]
(timbre/info (str "i18n: key is " (first args) " messages map is " messages))
(if (map? messages) (get messages (keyword (first args)) default) default))))
(if (map? messages) (or (messages (keyword (first args))) default) default))))


(deftype RenderableTemplate [template params]
Expand Down
12 changes: 6 additions & 6 deletions src/smeagol/routes/wiki.clj
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
(ns ^{:doc "Render all the main pages of a very simple Wiki engine."
:author "Simon Brooke"}
smeagol.routes.wiki
(:require [clojure.walk :refer :all]
(:require [cemerick.url :refer (url url-encode url-decode)]
[clj-jgit.porcelain :as git]
[clojure.java.io :as cjio]
[clojure.string :as cs]
[cemerick.url :refer (url url-encode url-decode)]
[clojure.walk :refer :all]
[compojure.core :refer :all]
[clj-jgit.porcelain :as git]
[noir.io :as io]
[noir.response :as response]
[noir.util.route :as route]
[noir.session :as session]
[taoensso.timbre :as timbre]
[smeagol.authenticate :as auth]
[smeagol.diff2html :as d2h]
[smeagol.formatting :refer [md->html]]
[smeagol.history :as hist]
[smeagol.layout :as layout]
[smeagol.routes.admin :as admin]
[smeagol.util :as util]
[smeagol.uploads :as ul]
[smeagol.history :as hist]
[smeagol.routes.admin :as admin]))
[taoensso.timbre :as timbre]))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
Expand Down
6 changes: 4 additions & 2 deletions src/smeagol/util.clj
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@
(merge
(i18n/get-messages
((:headers request) "accept-language")
(cjio/file (io/resource-path) "i18n")
;; (cjio/file (io/resource-path) "i18n")
"i18n"
"en-GB")
config))
config)
)


(def get-messages (memoize raw-get-messages))
Expand Down

0 comments on commit fab37d5

Please sign in to comment.