the there is no way to specify for the string reso...
# multiplatform
y
the there is no way to specify for the string resource which language I want ? here it generate for the string resource "general", 2 values one for ar and other one for english since english is first it seem to set it on english
Copy code
public val Res.string.general: StringResource
  get() = CommonMainString0.general

private fun init_general(): StringResource = org.jetbrains.compose.resources.StringResource(
  "string:general", "general",
    setOf(
     
    org.jetbrains.compose.resources.ResourceItem(setOf(org.jetbrains.compose.resources.LanguageQualifier("en"),
    ), "composeResources/resources/values-en/strings.commonMain.cvr", 1119, 27),
      org.jetbrains.compose.resources.ResourceItem(setOf(),
    "composeResources/resources/values/strings.commonMain.cvr", 14152, 23),
    )
)
s
I created this a while ago do that but it hasn’t been reviewed. https://github.com/JetBrains/compose-multiplatform/pull/4703
y
added it but didn't work
Copy code
CompositionLocalProvider(LocalResourceLocale provides Locale("en")) {
isn't it supposed to override the value of Locale, unless Locale is not used in JB impl
s
It hasn’t been merged, by default it usages Locale.current from compose.ui package which is not composition locale.
y
if it by default uses Locale.current then if I have something like this
Copy code
val LocalResourceLocale = compositionLocalOf { Locale.current }
then this
Copy code
CompositionLocalProvider(LocalResourceLocale provides Locale("en")) { content()
}
then why doesn't it work ?
s
As you can see here the Local.current is not a composite local so we can’t override it. The pr above provides a way to override the locale for resources. https://androidx.tech/artifacts/compose.ui/ui-text/1.2.0-source/androidx/compose/ui/text/intl/Locale.kt.html
thank you color 1