https://kotlinlang.org logo
Title
j

jeggy

06/23/2020, 4:12 PM
Anyone have any best practices for localization within ktor? I'm thinking something like all my exceptions should extend some special exception that will have support for some format of resources and then use the "Content-Language" header provided by the client to return localized error messages.
m

Matteo Mirk

06/24/2020, 7:39 AM
Never thought about that, but this idea of localized exceptions is cool.
j

jeggy

06/25/2020, 9:04 AM
This pattern was somewhat inspired of how C# .NET MVC does it. While we don't want the 5xx HTTP to be localized. We do want to return 4xx error messages to client localized.
👍 1