-
-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
What's the performance of this library? Do you plan to add any benchmarks?
On first sight there appears to be a longer startup time with this library vs a custom platform-specific implementation, but maybe I'm doing something wrong. Thus, some more information about performance would clear things up for me (and many others)!
Click to see example
Example custom implementation w/o this lib
This is what my setup looked like without this library.
commonMain/.../L18n.kt:
@Composable
@ReadOnlyComposable
expect fun translate(key: String): StringandroidMain/.../L18n.kt:
package com.example.common.platform
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.ui.res.stringResource
import com.example.common.R
@ReadOnlyComposable
@Composable
actual fun translate(key: String): String {
val stringClass = R.string::class.java
val field = stringClass.getDeclaredField(key)
return stringResource(field.get(stringClass) as Int)
}iosMain/.../L18n.kt:
Not implemented yet, but same principle
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels