【问题标题】:How to change the error message's information and language?如何更改错误消息的信息和语言?
【发布时间】:2022-10-16 07:46:31
【问题描述】:

在我的页面中,我收到消息谎言“发生错误!”

该消息不适合我的项目。

我想更改信息和语言。

我在以下位置找到了消息:


\node_modules\abp-ng2-module\dist\bundles\abp-ng2-module.umd.js(353,27)  
\node_modules\abp-ng2-module\dist\bundles\abp-ng2-module.umd.min.js(1,8628)  
\node_modules\abp-ng2-module\dist\src\abpHttpInterceptor.js(33,23)
\node_modules\abp-ng2-module\dist\src\abpHttpInterceptor.js.map(1,12129) 
\node_modules\abp-ng2-module\src\abpHttpInterceptor.ts(66,19)
\node_modules\abp-web-resources\Abp\Framework\scripts\libs\abp.jquery.js(65,21)
\node_modules\abp-web-resources\Abp\Framework\scripts\libs\abp.jquery.min.js(1,841) 
\node_modules\abp-web-resources\Abp\Framework\scripts\libs\angularjs\abp.ng.js(11,23)
\node_modules\abp-web-resources\Abp\Framework\scripts\libs\angularjs\abp.ng.min.js(1,70)
 

例如 来源是

var AbpHttpConfiguration = /** @class */ (function () {
    function AbpHttpConfiguration(_messageService, _logService) {
        this._messageService = _messageService;
        this._logService = _logService;
        this.defaultError = {
            message: 'An error has occurred!',
            details: 'Error details were not sent by server.'
        };
        this.defaultError401 = {
            message: 'You are not authenticated!',
            details: 'You should be authenticated (sign in) in order to perform this operation.'
        };
        this.defaultError403 = {
            message: 'You are not authorized!',
            details: 'You are not allowed to perform this operation.'
        };
        this.defaultError404 = {
            message: 'Resource not found!',
            details: 'The resource requested could not be found on the server.'
        };
    }

问题

  1. 我想更改消息。我该怎么做?
  2. 我想把英文改成中文。是否有任何设置可以更改消息的语言?

    需要你的帮助。谢谢。

【问题讨论】:

  • 尝试搜索i18n支持多国语言

标签: aspnetboilerplate


【解决方案1】:

您可以预加载前端本地化器然后使用它(本地化器),或者您可以覆盖中文的功能消息

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-01-09
    • 1970-01-01
    • 1970-01-01
    • 2023-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多