@@ -15,9 +15,7 @@ import java.util.*
1515
1616class MainActivity : ComponentActivity () {
1717
18- val tolgee = Tolgee .instanceOrInit {
19-
20- }
18+ val tolgee = Tolgee .instance
2119
2220 override fun attachBaseContext (newBase : Context ? ) {
2321 super .attachBaseContext(TolgeeContextWrapper .wrap(newBase))
@@ -35,7 +33,7 @@ class MainActivity : ComponentActivity() {
3533 val array = findViewById<TextView >(R .id.array_text)
3634
3735 lifecycleScope.launch {
38- tolgee.translation (
36+ tolgee.tFlow (
3937 context = this @MainActivity,
4038 id = R .string.description
4139 ).collect { value ->
@@ -45,7 +43,7 @@ class MainActivity : ComponentActivity() {
4543 }
4644 }
4745 lifecycleScope.launch {
48- tolgee.translation (
46+ tolgee.tFlow (
4947 context = this @MainActivity,
5048 id = R .string.percentage_placeholder,
5149 87
@@ -56,7 +54,7 @@ class MainActivity : ComponentActivity() {
5654 }
5755 }
5856 lifecycleScope.launch {
59- tolgee.pluralTranslation (
57+ tolgee.tPluralFlow (
6058 resources = this @MainActivity.resources,
6159 id = R .plurals.plr_test_placeholder_2,
6260 3 , 2 , 3 , " Plurals"
@@ -67,7 +65,7 @@ class MainActivity : ComponentActivity() {
6765 }
6866 }
6967 lifecycleScope.launch {
70- tolgee.stringArrayTranslation (
68+ tolgee.tArrayFlow (
7169 resources = this @MainActivity.resources,
7270 id = R .array.array_test
7371 ).collect { value ->
0 commit comments