25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

* src/translate.erl: When a translation file can't be loaded, show

detailed error message

SVN Revision: 1669
This commit is contained in:
Badlop 2008-10-24 22:16:17 +00:00
parent 9d521c9dd0
commit ff6891cdd0
2 changed files with 12 additions and 1 deletions

View File

@ -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'.

View File

@ -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) ->