Commits

Meikel Brandmeyer committed 21ee899

Add init-bundles!

  • Participants
  • Parent commits cb227dc

Comments (0)

Files changed (1)

File src/main/clojure/j18n/core.clj

       (alter-meta! *ns* assoc ::bundle (var ~bundle-name))
       (swap! @#'bundles assoc (var ~bundle-name) ~package)
       (var ~bundle-name))))
+
+(defn init-bundles!
+  "Initialise all bundles defined with defbundle. This should only be called
+  once during application startup and initialisation."
+  []
+  (doseq [[v p] @bundles]
+    (alter-var-root v (constantly (ResourceBundle/getBundle p)))))