tFlow

fun tFlow(context: Context, @StringRes id: Int): Flow<String>(source)

Retrieves a translation for the given string resource ID and emits the localized text as a Flow.

It initially emits the string from the Android app's resources. If a translation key is obtained from the string resource ID, it emits subsequent translations fetched from Tolgee integration.

Return

A Flow emitting localized text, starting with the Android string resource and followed by the corresponding Tolgee translations, if available.

Parameters

context

The application context used to access the string resources.

id

The resource ID of the string to be translated.


fun tFlow(context: Context, @StringRes id: Int, vararg formatArgs: Any): Flow<String>(source)

Provides a flow of translated strings for a given string resource ID with optional formatting arguments. The method first emits the string resolved from the context's resources. If the key corresponding to the string resource ID exists, it emits translations for the key using the provided formatting arguments.

Return

a flow of translated strings

Parameters

context

the Android context used to resolve the string resource

id

the string resource ID

formatArgs

optional arguments to format the string resource