diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Timeago/TimeagoScriptContributor.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Timeago/TimeagoScriptContributor.cs index df9ac55c42..a276849db6 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Timeago/TimeagoScriptContributor.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Packages/Volo/Abp/AspNetCore/Mvc/UI/Packages/Timeago/TimeagoScriptContributor.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Globalization; using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Packages.JQuery; using Volo.Abp.Modularity; @@ -12,5 +13,16 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Packages.Timeago { context.Files.AddIfNotContains("/libs/timeago/jquery.timeago.js"); } + + public override void ConfigureDynamicResources(BundleConfigurationContext context) + { + var cultureName = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName; + var cultureFileName = $"/libs/timeago/locales/jquery.timeago.{cultureName}.js"; + + if (context.FileProvider.GetFileInfo(cultureFileName).Exists) + { + context.Files.Add(cultureFileName); + } + } } } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js index db56e86c98..6b8ed10120 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/bootstrap/dom-event-handlers.js @@ -60,6 +60,8 @@ container: 'body' }); + args.$el.findWithSelf('.timeago').timeago(); + enableFormFeatures(args.$el.findWithSelf('form'), true); initializeScript(args.$el); @@ -82,6 +84,8 @@ container: 'body' }); + $('.timeago').timeago(); + $('[data-auto-focus="true"]').first().findWithSelf('input,select').focus(); });