Skip to content

Commit dd08ac2

Browse files
committed
chore: mention context wrapper in readme
1 parent 804c1eb commit dd08ac2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

core/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ val textWithParams = tolgee.t(context, R.string.string_with_params, "param1", "p
122122

123123
// Get a translation with fallback to Android resources as a Flow
124124
val textFlow = tolgee.tFlow(context, R.string.string_key)
125+
126+
// Wrap the context of your Activity to override what is returned by getString-like methods
127+
class MyActivity : Activity() {
128+
override fun attachBaseContext(newBase: Context?) {
129+
super.attachBaseContext(TolgeeContextWrapper.wrap(newBase))
130+
}
131+
}
125132
```
126133

127134
### Locale Management

0 commit comments

Comments
 (0)