diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props index 52e83b4b5..7603836e9 100644 --- a/src/Directory.Packages.props +++ b/src/Directory.Packages.props @@ -16,29 +16,29 @@ - + - - + + - + - - - - + + + + - - - + + + - - + + @@ -46,11 +46,11 @@ - - + + - + @@ -58,19 +58,19 @@ - - + + - + - + @@ -80,13 +80,13 @@ - + - + - - - - + + + + \ No newline at end of file diff --git a/src/Shared/Constants/LanguageCode.cs b/src/Shared/Constants/LanguageCode.cs new file mode 100644 index 000000000..fe21d4669 --- /dev/null +++ b/src/Shared/Constants/LanguageCode.cs @@ -0,0 +1,7 @@ +namespace FSH.Starter.Shared.Constants; + +public class LanguageCode +{ + public string DisplayName { get; set; } + public string Code { get; set; } +} diff --git a/src/Shared/Constants/LocalizationConstants.cs b/src/Shared/Constants/LocalizationConstants.cs new file mode 100644 index 000000000..5e9401622 --- /dev/null +++ b/src/Shared/Constants/LocalizationConstants.cs @@ -0,0 +1,17 @@ +namespace FSH.Starter.Shared.Constants; + +public static class LocalizationConstants +{ + public static readonly LanguageCode[] SupportedLanguages = { + new LanguageCode + { + Code = "en-US", + DisplayName= "English" + }, + new LanguageCode + { + Code = "af-ZA", + DisplayName = "Afrikaans" + } + }; +} diff --git a/src/api/framework/Core/Persistence/DatabaseOptions.cs b/src/api/framework/Core/Persistence/DatabaseOptions.cs index 5be4fb9e0..459dc30c6 100644 --- a/src/api/framework/Core/Persistence/DatabaseOptions.cs +++ b/src/api/framework/Core/Persistence/DatabaseOptions.cs @@ -1,9 +1,10 @@ using System.ComponentModel.DataAnnotations; namespace FSH.Framework.Core.Persistence; + public class DatabaseOptions : IValidatableObject { - public string Provider { get; set; } = "postgresql"; + public string Provider { get; set; } = "mssql"; public string ConnectionString { get; set; } = string.Empty; public IEnumerable Validate(ValidationContext validationContext) diff --git a/src/api/framework/Infrastructure/Extensions.cs b/src/api/framework/Infrastructure/Extensions.cs index 865bce172..26a60dd79 100644 --- a/src/api/framework/Infrastructure/Extensions.cs +++ b/src/api/framework/Infrastructure/Extensions.cs @@ -37,6 +37,10 @@ public static WebApplicationBuilder ConfigureFshFramework(this WebApplicationBui builder.AddServiceDefaults(); builder.ConfigureSerilog(); builder.ConfigureDatabase(); + builder.Services.AddLocalization(options => + { + options.ResourcesPath = "Resources"; + }); builder.Services.ConfigureMultitenancy(); builder.Services.ConfigureIdentity(); builder.Services.AddCorsPolicy(builder.Configuration); diff --git a/src/api/modules/Catalog/Catalog.Infrastructure/Persistence/CatalogDbContext.cs b/src/api/modules/Catalog/Catalog.Infrastructure/Persistence/CatalogDbContext.cs index 1dc8297ed..4c61f1ac6 100644 --- a/src/api/modules/Catalog/Catalog.Infrastructure/Persistence/CatalogDbContext.cs +++ b/src/api/modules/Catalog/Catalog.Infrastructure/Persistence/CatalogDbContext.cs @@ -22,6 +22,7 @@ public CatalogDbContext(IMultiTenantContextAccessor multiTenantCo protected override void OnModelCreating(ModelBuilder modelBuilder) { ArgumentNullException.ThrowIfNull(modelBuilder); + base.OnModelCreating(modelBuilder); modelBuilder.ApplyConfigurationsFromAssembly(typeof(CatalogDbContext).Assembly); modelBuilder.HasDefaultSchema(SchemaNames.Catalog); } diff --git a/src/api/modules/Todo/Persistence/TodoDbContext.cs b/src/api/modules/Todo/Persistence/TodoDbContext.cs index 37a6671d9..99b34e456 100644 --- a/src/api/modules/Todo/Persistence/TodoDbContext.cs +++ b/src/api/modules/Todo/Persistence/TodoDbContext.cs @@ -20,6 +20,7 @@ public TodoDbContext(IMultiTenantContextAccessor multiTenantConte protected override void OnModelCreating(ModelBuilder modelBuilder) { ArgumentNullException.ThrowIfNull(modelBuilder); + base.OnModelCreating(modelBuilder); modelBuilder.ApplyConfigurationsFromAssembly(typeof(TodoDbContext).Assembly); modelBuilder.HasDefaultSchema(SchemaNames.Todo); } diff --git a/src/api/server/appsettings.Development.json b/src/api/server/appsettings.Development.json index e4ff07d0c..603e899e4 100644 --- a/src/api/server/appsettings.Development.json +++ b/src/api/server/appsettings.Development.json @@ -1,7 +1,7 @@ { "DatabaseOptions": { - "Provider": "postgresql", - "ConnectionString": "Server=192.168.1.110;Database=fullstackherodb;User Id=postgres;Password=password" + "Provider": "mssql", + "ConnectionString": "Data Source=KALLIENTB;Integrated Security=True;User ID=Kallientb\\Kallie;Database=RUMAS_ROOT;TrustServerCertificate=True;" }, "OriginOptions": { "OriginUrl": "https://localhost:7000" diff --git a/src/apps/blazor/client/Client.csproj b/src/apps/blazor/client/Client.csproj index 9b732733b..5a7038e57 100644 --- a/src/apps/blazor/client/Client.csproj +++ b/src/apps/blazor/client/Client.csproj @@ -7,12 +7,14 @@ FSH.Starter.Blazor.Client FSH.Starter.Blazor.Client service-worker-assets.js + true + diff --git a/src/apps/blazor/client/Components/Common/TablePager.razor b/src/apps/blazor/client/Components/Common/TablePager.razor index 71bb4ed69..b2a851c3b 100644 --- a/src/apps/blazor/client/Components/Common/TablePager.razor +++ b/src/apps/blazor/client/Components/Common/TablePager.razor @@ -1 +1,2 @@ - \ No newline at end of file +@inject Microsoft.Extensions.Localization.IStringLocalizer _localizer + \ No newline at end of file diff --git a/src/apps/blazor/client/Components/Dialogs/DeleteConfirmation.razor b/src/apps/blazor/client/Components/Dialogs/DeleteConfirmation.razor index da39f6413..ee27acdec 100644 --- a/src/apps/blazor/client/Components/Dialogs/DeleteConfirmation.razor +++ b/src/apps/blazor/client/Components/Dialogs/DeleteConfirmation.razor @@ -1,16 +1,17 @@ - +@inject Microsoft.Extensions.Localization.IStringLocalizer _localizer + - Delete Confirmation + @_localizer["Delete Confirmation"] @ContentText - Cancel - Confirm + @_localizer["Cancel"] + @_localizer["Confirm"] diff --git a/src/apps/blazor/client/Components/Dialogs/Logout.razor b/src/apps/blazor/client/Components/Dialogs/Logout.razor index 202ac8717..91a93088b 100644 --- a/src/apps/blazor/client/Components/Dialogs/Logout.razor +++ b/src/apps/blazor/client/Components/Dialogs/Logout.razor @@ -1,5 +1,5 @@ @namespace FSH.Starter.Blazor.Client.Components.Dialogs - +@inject Microsoft.Extensions.Localization.IStringLocalizer _localizer @inject IAuthenticationService AuthService @@ -7,14 +7,14 @@ - Logout Confirmation + @_localizer["Logout Confirmation"] @ContentText - Cancel + @_localizer["Cancel"] @ButtonText diff --git a/src/apps/blazor/client/Components/EntityTable/AddEditModal.razor b/src/apps/blazor/client/Components/EntityTable/AddEditModal.razor index 4d18b0f3c..00e0cd8cc 100644 --- a/src/apps/blazor/client/Components/EntityTable/AddEditModal.razor +++ b/src/apps/blazor/client/Components/EntityTable/AddEditModal.razor @@ -1,4 +1,5 @@ -@typeparam TRequest +@inject Microsoft.Extensions.Localization.IStringLocalizer _localizer +@typeparam TRequest @@ -29,21 +30,20 @@ - Cancel + @_localizer["Cancel"] @if (IsCreate) { - Save + @_localizer["Save"] } else { - Update + @_localizer["Update"] } - \ No newline at end of file diff --git a/src/apps/blazor/client/Components/EntityTable/EntityTable.razor b/src/apps/blazor/client/Components/EntityTable/EntityTable.razor index cad1b9b48..f3e672d8f 100644 --- a/src/apps/blazor/client/Components/EntityTable/EntityTable.razor +++ b/src/apps/blazor/client/Components/EntityTable/EntityTable.razor @@ -1,9 +1,8 @@ -@typeparam TEntity +@inject Microsoft.Extensions.Localization.IStringLocalizer _localizer +@typeparam TEntity @typeparam TId @typeparam TRequest - @inject IJSRuntime JS -