string Resource
Replace your context.getString() with this function. Similar to getString, but for Compose functions
stringResource(LocalContext.current, R.strings.hello, "World", Locale("es"))
getString(LocalContext.current, R.strings.name)Content copied to clipboard
Return
A String containing the translated text.
Parameters
context
The context. Usually set to LocalContext.current
id
The resource ID of the string to translate.
format Args
optional parameters if your resource string takes parameters like "Hello $1%s"