How to localize error messages #180
Hi! I have two questions to ask:
- Is there a way to localize the error message for AbpAuthorizationException?
- Can the localization file "AbpWeb.xml" be overrided? and if so, how to do it?
Localizations can be overrided.
First, you should check current localizations: https://github.com/aspnetboilerplate/as ... bXmlSource
Then you can override it or add new texts/languages in your module's preinitialize:
Check and try it. if you can not do it write here again.
Have a nice day.
Hi, I need more help. Now I still get the the wrong local message when I learning the sample in Module Zero. When I try to add a question, a exception is thrown in QuestionAppService, then I get the follow error: "An internal error occurred during your request!"
How can I localize it?
PS. Here is what did I do:
- Build a language file(actually is Chinese, already added in Module Zero) and add it to Location directory in Web project.
|--Localization |----AbpExtends |------AbpExtends.en.xml |------AbpExtends.xml
- Add follow codes in Web project's preinitialize:
Configuration.Localization.Sources.Add( new XmlLocalizationSource( "AbpExtends", HttpContext.Current.Server.MapPath("~/Localization/AbpExtends") ) );