ubeac / ubeac-api

Source of uBeac .NET Core packages
3 stars 2 forks source link

Implement Localization #162

Open ilhesam opened 1 year ago

ilhesam commented 1 year ago

What do we want in this phase?

uBeac.Core.Localization.Abstractions

We will have an entity:

public class LocalizationValue : Entity
{
    public string Key { get; set; } // "welcome-message"
    public string Value { get; set; } // "Welcome to uBeac!"
    public string CultureName { get; set; } // "en-US"
}

Also the following interfaces:

public interface ILocalizationRepository : IService
{
    // CRUD methods
}

public interface ILocalizationService : IService
{
    // CRUD methods
}

public interface ILocalizationCachingService : IService
{
    // Storing and retrieving data
}

We should implement these interfaces in the another packages:

Registration

services.AddCustomLocalization(localization =>
{
    localization.UseJsonFiles();
    localization.UseInMemoryCaching();
});