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