Commits

Meikel Brandmeyer committed c804b53

Refactor translate

Comments (0)

Files changed (1)

src/main/clojure/j18n/core.clj

   used."
   ([message]
    {:pre [(or (string? message) (keyword? message))]}
-   (let [bundle (if (keyword? message)
-                  (if-let [nspace (namespace message)]
-                    (::bundle (meta (the-ns (symbol nspace))))
-                    (::bundle (meta *ns*)))
-                  (::bundle (meta *ns*)))]
+   (let [bundle (or (message-to-bundle message) (::bundle (meta *ns*)))]
      `(translate ~message ~bundle)))
   ([message bundle]
    {:pre [(or (string? message) (keyword? message))]}
-   `(translate* ~(if (keyword? message) (name message) message) ~bundle)))
+   `(translate* ~(name message) ~bundle)))