compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

overridable resource locale

Open psuzn opened this issue 1 year ago • 3 comments

Add a way to override local for the resources (partially address #4197).

Similar to how we override the density with the LocalDensity composition provider it adds LocalResourceLocale to override Locale for Resource.

Usage

 CompositionLocalProvider(LocalResourceLocale provides Locale("np")) {
  Text(stringResource(Res.string.hello))
}

psuzn avatar Apr 26 '24 06:04 psuzn

@terrakok, can you review this, please?

psuzn avatar May 02 '24 02:05 psuzn

Will this be available in 1.6.10?

toaster217 avatar May 09 '24 07:05 toaster217

Will this be available in 1.6.10?

No

MatkovIvan avatar May 13 '24 08:05 MatkovIvan

@terrakok @MatkovIvan Are there any possible issues this change might cause? If not, it would great to have the possibility to handle the app language in Compose. I would be more than happy to help move this forward.

kaidotarma avatar Jun 08 '24 19:06 kaidotarma

The feature should be implemented in the core/runtime modules, not in the library. Because it is a more general thing. You may track the progress here: https://github.com/JetBrains/compose-multiplatform/issues/4347 Sorry for the long reply

terrakok avatar Jun 25 '24 10:06 terrakok