Skip to content

Commit

Permalink
Ensure that foo.bar, foo/bar both reach same translation
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Oct 13, 2014
1 parent 04fa30b commit 56eb9a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/taoensso/tower.cljx
Expand Up @@ -609,7 +609,9 @@
(defn- find1 ; This fn is perf sensitive, but isn't easily memo'd
([dict scope k ltree] ; Find scoped
(let [[l1 :as ls] ltree
scoped-k (if-not scope k (scoped scope k))]
scoped-k ; (if-not scope k (scoped scope k))
(scoped scope k) ; Even with nil scope, to get ns/kw form
]
(if (next ls)
(some #(get-in dict [scoped-k %]) ls)
(do (get-in dict [scoped-k l1])))))
Expand Down
1 change: 1 addition & 0 deletions test/taoensso/tower/tests/main.clj
Expand Up @@ -148,6 +148,7 @@

;;; Basic locale selection & fallback
(expect ":en :example/foo text" (pt :en :example/foo)) ; :en
(expect ":en :example/foo text" (pt :en :example.foo)) ; :en
(expect ":en-US :example/foo text" (pt :en-US :example/foo)) ; :en-US
(expect ":en :example/foo text" (pt :en-GB :example/foo)) ; :en-GB -> :en
(expect ":de :example/foo text" (pt :zh-CN :example/foo)) ; :zh-CN -> :zh -> fb-loc
Expand Down

0 comments on commit 56eb9a3

Please sign in to comment.