© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•7mo ago•
2 replies
Sher

Localization in Clean Architectire

I'm working on a project which requires localization on a presentation layer and I don't know which layer I should put my localization service in.
By default I wanted to put it in the presentation, since it seems to be the easiest approach and that's what ChatGPT told me to do. But the problem with this is that if I will have multiple presentation layers I will have to create a service for each layer. Another problem with this is that I can't use localization in Application layer which returns some messages (exception messages, validation errors) and I have to use enums for each error in my request:
public record CreateProductRequest(ulong ShopId, ProductModel ProductModel)
    : IRequest<Result<CreateProductRequest.Error>>
{
    public enum Error
    {
        ValidationFailed,
        ShopNotFound,
        TooManyProductsCreated,
        ShopIsBlocked
    }
}
public record CreateProductRequest(ulong ShopId, ProductModel ProductModel)
    : IRequest<Result<CreateProductRequest.Error>>
{
    public enum Error
    {
        ValidationFailed,
        ShopNotFound,
        TooManyProductsCreated,
        ShopIsBlocked
    }
}

It looks pretty messy and I think it would be better to store and localizizations as well as Lozalization service in Infrastructure layer.
What is your opinion about this?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Localization behavior in tests
C#CC# / help
3y ago
✅ Auth in Clean Architecture
C#CC# / help
8mo ago
✅ .NET Localization Culture Fallback
C#CC# / help
3y ago
Clean Architecture
C#CC# / help
17mo ago