Server-Side Kotlin with Ktor · Challenge: About Template |

This is a companion discussion topic for the original entry at

Hi Joe! I have a few questions on localization. What is the best/suggested way to localize a Ktor web app? Using standard java properties files are good enough or is there some more “kotliner” way? And what if my client has localized texts in backend database to be able to upgrade them on his own anytime he wants? Is it a good idea to fetch localized texts from DB through Exposed and MySql when the app is starting? Is there “application context” or something similar in Ktor where I can save my application wide data (e.g. translations of all supported languages)?

Thanks for the question, @zsoltkiss!

I don’t see anything in the Ktor docs specific to localization or application context. I’d probably start looking at localization at the template level, for example like this with FreeMarker:

And trying standard Java ways of resource localization sounds like a good option too.

We’ll try and investigate this in a future course, but in the meantime let us know here if you find any more info on this. Thanks again!