Browse Source

Localized default 4xx messages

pull/279/head
Halil İbrahim Kalkan 9 years ago
parent
commit
efed02689e
  1. 22
      npm/packs/jquery/src/abp.ajax.js
  2. 6
      src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs
  3. 12
      src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json
  4. 10
      src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json

22
npm/packs/jquery/src/abp.ajax.js

@ -174,15 +174,17 @@
return abp.ajax.ajaxSendHandler(event, request, settings); return abp.ajax.ajaxSendHandler(event, request, settings);
}); });
//abp.event.on('abp.dynamicScriptsInitialized', function () { abp.event.on('abp.configurationInitialized', function () {
// abp.ajax.defaultError.message = abp.localization.abpWeb('DefaultError'); var l = abp.localization.getResource('AbpUi');
// abp.ajax.defaultError.details = abp.localization.abpWeb('DefaultErrorDetail');
// abp.ajax.defaultError401.message = abp.localization.abpWeb('DefaultError401'); abp.ajax.defaultError.message = l('DefaultErrorMessage');
// abp.ajax.defaultError401.details = abp.localization.abpWeb('DefaultErrorDetail401'); abp.ajax.defaultError.details = l('DefaultErrorMessageDetail');
// abp.ajax.defaultError403.message = abp.localization.abpWeb('DefaultError403'); abp.ajax.defaultError401.message = l('DefaultErrorMessage401');
// abp.ajax.defaultError403.details = abp.localization.abpWeb('DefaultErrorDetail403'); abp.ajax.defaultError401.details = l('DefaultErrorMessage401Detail');
// abp.ajax.defaultError404.message = abp.localization.abpWeb('DefaultError404'); abp.ajax.defaultError403.message = l('DefaultErrorMessage403');
// abp.ajax.defaultError404.details = abp.localization.abpWeb('DefaultErrorDetail404'); abp.ajax.defaultError403.details = l('DefaultErrorMessage403Detail');
//}); abp.ajax.defaultError404.message = l('DefaultErrorMessage404');
abp.ajax.defaultError404.details = l('DefaultErrorMessage404Detail');
});
})(jQuery); })(jQuery);

6
src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ApplicationConfigurations/AbpApplicationConfigurationScriptController.cs

@ -35,9 +35,11 @@ namespace Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations
var script = new StringBuilder(); var script = new StringBuilder();
script.AppendLine("(function(){"); script.AppendLine("(function(){");
script.AppendLine();
script.AppendLine($"$.extend(true, abp, {_jsonSerializer.Serialize(config, indented: Debugger.IsAttached)})"); script.AppendLine($"$.extend(true, abp, {_jsonSerializer.Serialize(config, indented: Debugger.IsAttached)})");
script.AppendLine();
script.AppendLine("abp.event.trigger('abp.configurationInitialized');");
script.AppendLine();
script.Append("})();"); script.Append("})();");
return script.ToString(); return script.ToString();

12
src/Volo.Abp.UI/Localization/Resources/AbpUi/en.json

@ -4,10 +4,14 @@
"InternalServerErrorMessage": "An internal error occurred during your request!", "InternalServerErrorMessage": "An internal error occurred during your request!",
"ValidationErrorMessage": "Your request is not valid!", "ValidationErrorMessage": "Your request is not valid!",
"ValidationNarrativeErrorMessageTitle": "The following errors were detected during validation.", "ValidationNarrativeErrorMessageTitle": "The following errors were detected during validation.",
"DefaultErrorMessage": "An error has occurred!", "DefaultErrorMessage": "An error has been occurred!",
"DefaultErrorMessage401": "You are not authenticated! You should sign in to perform this operation.", "DefaultErrorMessageDetail": "Error detail not sent by server.",
"DefaultErrorMessage403": "You are not allowed to perform this operation!", "DefaultErrorMessage401": "You are not authenticated!",
"DefaultErrorMessage404": "The resource requested could not found on the server!", "DefaultErrorMessage401Detail": "You should sign in to perform this operation.",
"DefaultErrorMessage403": "You are not authorized!",
"DefaultErrorMessage403Detail": "You are not allowed to perform this operation!",
"DefaultErrorMessage404": "Resource not found!",
"DefaultErrorMessage404Detail": "The resource requested could not found on the server!",
"EntityNotFoundErrorMessage": "There is no entity {0} with id = {1}!", "EntityNotFoundErrorMessage": "There is no entity {0} with id = {1}!",
"AreYouSure": "Are you sure?", "AreYouSure": "Are you sure?",
"Cancel": "Cancel", "Cancel": "Cancel",

10
src/Volo.Abp.UI/Localization/Resources/AbpUi/tr.json

@ -5,9 +5,13 @@
"ValidationErrorMessage": "İşleminiz geçerli değil!", "ValidationErrorMessage": "İşleminiz geçerli değil!",
"ValidationNarrativeErrorMessageTitle": "Aşağıdaki hatalar doğrulama sırasında tespit edilmiştir.", "ValidationNarrativeErrorMessageTitle": "Aşağıdaki hatalar doğrulama sırasında tespit edilmiştir.",
"DefaultErrorMessage": "Bir hata oluştu!", "DefaultErrorMessage": "Bir hata oluştu!",
"DefaultErrorMessage401": "Giriş yapılmamış! Bu işlemi gerçekleştirmek için uygulamaya giriş yapmalısınız.", "DefaultErrorMessageDetail": "Hatanın ne olduğu sunucu tarafından gönderilmedi.",
"DefaultErrorMessage403": "Bu işlemi gerçekleştirmek için gereken izne sahip değilsiniz!", "DefaultErrorMessage401": "Giriş yapılmamış!",
"DefaultErrorMessage404": "İstenilen kaynak sunucuda bulunamadı!", "DefaultErrorMessage401Detail": "Bu işlemi gerçekleştirmek için uygulamaya giriş yapmalısınız.",
"DefaultErrorMessage403": "İzinsiz işlem!",
"DefaultErrorMessage403Detail": "Bu işlemi gerçekleştirmek için gereken izne sahip değilsiniz.",
"DefaultErrorMessage404": "Kaynak bulunamadı!",
"DefaultErrorMessage404Detail": "İstenilen kaynak sunucuda bulunamadı.",
"EntityNotFoundErrorMessage": "Id değeri {1} olan {0} türünden bir nesne bulunamadı!", "EntityNotFoundErrorMessage": "Id değeri {1} olan {0} türünden bir nesne bulunamadı!",
"AreYouSure": "Emin misiniz?", "AreYouSure": "Emin misiniz?",
"Cancel": "Vazgeç", "Cancel": "Vazgeç",

Loading…
Cancel
Save