https://kotlinlang.org logo
Title
s

Sebastian Kürten

10/01/2021, 7:48 AM
does anybody know if localization using
strings.xml
is supported already (or planned?)
r

rsktash

10/01/2021, 8:31 AM
I think it won't be supported. Use moko resources
1
j

Javier

10/01/2021, 11:12 AM
I created this issue https://github.com/icerockdev/moko-resources/issues/249 @rsktash do you know if it is possible already?
r

rsktash

10/01/2021, 11:13 AM
@Javier Using expect actual you can achieve it
j

Javier

10/01/2021, 11:14 AM
yeah, but I would like moko resouces exposes it by default
r

rsktash

10/01/2021, 11:17 AM
@Javier For android it needs context for ios its not needed
j

Javier

10/01/2021, 11:17 AM
compose can get the context from a compositionLocal
so you can get it implicitly and the consumer doesn't need to pass it
and this would only be for compose, not iOS
something like
stringResource(MR.strings.some_string)
inside a composable function
I think in JVM it is using the same than in iOS,
getMyString().localized()
, this should be used for compose too
cc @alex009 what do you think?
a

alex009

10/09/2021, 8:04 PM