https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
g

galex

02/05/2019, 7:24 AM
Do we have a solution for localization? Like having common code that returns localized strings, with a single source of localized strings per language in common module?
👍 1
1
l

louiscad

02/05/2019, 7:40 AM
Maybe we could write a Gradle plugin that copies Android resource strings to the iOS way of doing localization?
g

galex

02/05/2019, 8:27 AM
I wanna think also about node / js, and jvm (backend).
r

ribesg

02/05/2019, 9:30 AM
@louiscad but does iOS support plurals and all that weird stuff?
👌 1
l

louiscad

02/05/2019, 10:01 AM
@ribesg I don't know, but if it doesn't, there should be a way to generate some code that brings support for it.
@galex Do you already have an idea of the API you would want to get from a usage standpoint for JVM and JS?
g

galex

02/05/2019, 10:03 AM
Not yet, still thinking about this
d

Denis Shurygin

02/05/2019, 11:01 AM
I have such implementation in my localization tool. Here is an example project https://github.com/PocketByte/locolaser-kotlin-mpp-example
🔥 1
👍 1
👀 1
g

galex

02/05/2019, 12:53 PM
Really nice @Denis Shurygin
I didn’t understand the file format but will go deeper once I solved other issues in my project.
j

josephivie

02/05/2019, 4:01 PM
Lokalize can get you the language and variant, but implementation of strings is up to you. I'd recommend making an interface with values and functions that return strings. https://github.com/lightningkite/lokalize It's in a Maven repository now; I'll be updating the readme to it later today.
🔥 1
2 Views