Skip to content

Commit

Permalink
fix: check file exists in extra translations loading
Browse files Browse the repository at this point in the history
  • Loading branch information
aatkin committed Sep 4, 2023
1 parent 5c40bf6 commit d15dc35
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/clj/rems/locales.clj
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@
(throw (FileNotFoundException.
(str "translations could not be found in file or resource \"" file "\"")))))

(defn- extra-translations-path [theme-path]
(let [theme-dir (.getParentFile (io/file theme-path))
path (io/file theme-dir "extra-translations")]
(when (.exists path)
path)))
(defn- get-file-exists [& paths]
(let [f (apply io/file paths)]
(when (.exists f)
f)))

(defn- extra-translations-path [path]
(when-let [theme-dir (some-> (get-file-exists path)
(.getParentFile))]
(get-file-exists theme-dir "extra-translations")))

(defn extract-format-parameters [string]
(set
Expand Down

0 comments on commit d15dc35

Please sign in to comment.