I18n with Kotlin

I want to use kotlin as a way to make string substitution on i18n.

The idea is creating files per language that could be downloaded dinamically upon language selection and use kotlin code to decide plurals, genere and so on. kinda :
{ bean: SomeClass, data: Map<String, Object> → "Lorem ipsum ${bean.someValue} … ${data["key"]}

And this for any platform … any ideas ??

The Apache Velocity template engine might be a fairly good match.

I don’t think it has specific functionality for plurals and other lingustic forms, but it’s very flexible. I’m not familiar with best practice in internationalisation, but I gather that it’s often better to interpolate whole sentences, as different languages can have very different sentence structures and other requirements (such as number and gender agreement) that can’t be handled by interpolating individual words.

Thank you
I don’t want to use Velocity (that if I don’t remember wrong is only Java) or any other framework for interpolation nor ICU or similar :slight_smile:
I want kotlin code to take care of idomatics and interpolation.
I want to have the i18n of each language in a separate file that can be downloaded by FE (web, android, ios) also made in kotlin., depending on user selection.
Let’s say I have:
frontend in Android, IOS and web … each of them should be able to download and execute the .kt files or the compile files on their platforms to carry out the i18n
My point is if there is a way to load this code dynamically into a/some running native MP application(s)

Or is there a way to have this classes in a repo. Download them and compile in “real time” in JS, Ios and Android