diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/translate.erl | 10 |
2 files changed, 12 insertions, 1 deletions
@@ -1,5 +1,8 @@ 2008-10-25 Badlop <badlop@process-one.net> + * src/translate.erl: When a translation file can't be loaded, show + detailed error message + * src/ejabberd_ctl.erl: If ejabberd didn't start correctly: 'ejabberdctl status' suggests to look in log files; any other ejabberdctl command shows 'status'. diff --git a/src/translate.erl b/src/translate.erl index eddea35e..0a7d6029 100644 --- a/src/translate.erl +++ b/src/translate.erl @@ -89,8 +89,16 @@ load_file(Lang, File) -> ets:insert(translations, {{Lang, Orig}, Trans1}) end, Terms); + %% Code copied from ejabberd_config.erl + {error, {_LineNumber, erl_parse, _ParseMessage} = Reason} -> + ExitText = lists:flatten(File ++ " approximately in the line " + ++ file:format_error(Reason)), + ?ERROR_MSG("Problem loading translation file ~n~s", [ExitText]), + exit(ExitText); {error, Reason} -> - exit(file:format_error(Reason)) + ExitText = lists:flatten(File ++ ": " ++ file:format_error(Reason)), + ?ERROR_MSG("Problem loading translation file ~n~s", [ExitText]), + exit(ExitText) end. translate(Lang, Msg) -> |