summaryrefslogtreecommitdiff
path: root/src/translate.erl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/translate.erl18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/translate.erl b/src/translate.erl
index 63507c8c..2e7f8722 100644
--- a/src/translate.erl
+++ b/src/translate.erl
@@ -18,12 +18,18 @@
start() ->
ets:new(translations, [named_table, public]),
- Dir = case os:getenv("EJABBERD_MSGS_PATH") of
- false ->
- ?MSGS_DIR;
- Path ->
- Path
- end,
+ Dir =
+ case os:getenv("EJABBERD_MSGS_PATH") of
+ false ->
+ case code:lib_dir(ejabberd) of
+ {error, _} ->
+ ?MSGS_DIR;
+ Path ->
+ filename:join([Path, "msgs"])
+ end;
+ Path ->
+ Path
+ end,
load_dir(Dir),
ok.