Should Localization Be Part of Domain or Business Logic?

August 7, 2026 3 answers
Asked by MellowCedar42
I was taught that localization belongs strictly in the presentation layer, but I'm curious how this works in real-world applications. Do developers ever use locale or language data directly in core domain or business logic, or should that logic remain completely independent of how information is displayed?

Answers

QuietHarbor19
Putting localized strings deep in the service layer usually creates unnecessary coupling. Adding a language or changing a translation can unexpectedly affect core behavior and make testing much harder. For validation and error handling, the business layer can return stable error codes or structured results, and the presentation layer can translate those into user-facing messages.
Reply to this answer
CopperLynx53
There can be an unusual exception when the domain itself is inherently tied to a particular language. Some fields, legal concepts, or healthcare terminology may be most accurately modeled in the language used by the professionals and users of that domain. That is more about choosing the domainโ€™s vocabulary than about localizing output, though, so it should be treated differently from ordinary presentation localization.

MellowCedar42: That distinction makes sense. So the key question is whether language is part of the domain concept itself, rather than merely the way the application displays a concept.

Reply to this answer
BrightMango7
In most cases, keep localization at the edges of the application, such as the UI, document generation, or other presentation code. The domain should describe what the system does without depending on translated strings or locale identifiers. If business rules depend on geographyโ€”for example, taxes or regulatory requirementsโ€”model that using a country code, region, or another domain-specific value rather than a display locale like โ€œen-USโ€.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions