Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Localization with Decompose #832

Open
eosobande opened this issue Dec 28, 2024 · 1 comment
Open

Localization with Decompose #832

eosobande opened this issue Dec 28, 2024 · 1 comment
Labels
question Further information is requested

Comments

@eosobande
Copy link

eosobande commented Dec 28, 2024

Using compose resources with localization, content inside Children & ChildStack does not recompose when locale is changed, until I navigate away and back.

I see the Children composable uses a hash string key to cache the content, thinking it has something to do with that.

`
val holder = rememberSaveableStateHolder()

holder.retainStates(stack.getConfigurations())

val animationProvider = LocalStackAnimationProvider.current
val anim = animation ?: remember(animationProvider, animationProvider::provide) ?: emptyStackAnimation()

anim(stack = stack, modifier = modifier) { child ->
    holder.SaveableStateProvider(child.configuration.hashString()) {
        content(child)
    }
}

`

I followed this tutorial https://medium.com/@dzenanbecirovicc/compose-multiplatform-localization-ec6745961ddc for localization

@arkivanov
Copy link
Owner

It should work automatically because everything is Composable. It might be a bug in Compose.

@arkivanov arkivanov added the question Further information is requested label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants