diff --git a/.idea/ktfmt.xml b/.idea/ktfmt.xml
new file mode 100644
index 0000000..f0d6dab
--- /dev/null
+++ b/.idea/ktfmt.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dachlatten-android/src/main/kotlin/de/sipgate/dachlatten/android/text/UiTextExt.kt b/dachlatten-android/src/main/kotlin/de/sipgate/dachlatten/android/text/UiTextExt.kt
index 9752401..e056a49 100644
--- a/dachlatten-android/src/main/kotlin/de/sipgate/dachlatten/android/text/UiTextExt.kt
+++ b/dachlatten-android/src/main/kotlin/de/sipgate/dachlatten/android/text/UiTextExt.kt
@@ -7,7 +7,7 @@ import de.sipgate.dachlatten.text.TranslatedText
import de.sipgate.dachlatten.text.UiText
import java.util.Locale
-fun UiText.asString(resources: Resources, fallbackLocale: Locale? = null) = when (this) {
+fun UiText.resolve(resources: Resources, fallbackLocale: Locale? = null) = when (this) {
is UiText.DynamicString -> value
is UiText.StringResource -> resources.getString(resId, *(args.toTypedArray()))
is UiText.MultiLangString -> {
diff --git a/dachlatten-android/src/test/kotlin/de/sipgate/dachlatten/android/text/UiTextTest.kt b/dachlatten-android/src/test/kotlin/de/sipgate/dachlatten/android/text/UiTextTest.kt
index 5b50e65..d25ab64 100644
--- a/dachlatten-android/src/test/kotlin/de/sipgate/dachlatten/android/text/UiTextTest.kt
+++ b/dachlatten-android/src/test/kotlin/de/sipgate/dachlatten/android/text/UiTextTest.kt
@@ -116,6 +116,6 @@ class UiTextTest {
}
private fun expectResolvedResourceString(expected: String, uiText: UiText, fallbackLocale: Locale? = null) {
- assertEquals(expected, uiText.asString(context.resources, fallbackLocale))
+ assertEquals(expected, uiText.resolve(context.resources, fallbackLocale))
}
}
diff --git a/dachlatten-compose/src/main/kotlin/de/sipgate/dachlatten/compose/text/UiTextExt.kt b/dachlatten-compose/src/main/kotlin/de/sipgate/dachlatten/compose/text/UiTextExt.kt
index 8452b69..71e89ce 100644
--- a/dachlatten-compose/src/main/kotlin/de/sipgate/dachlatten/compose/text/UiTextExt.kt
+++ b/dachlatten-compose/src/main/kotlin/de/sipgate/dachlatten/compose/text/UiTextExt.kt
@@ -11,7 +11,7 @@ import de.sipgate.dachlatten.text.UiText
import java.util.Locale
@Composable
-fun UiText.asString(fallbackLocale: Locale? = null) = when (this) {
+fun UiText.resolve(fallbackLocale: Locale? = null) = when (this) {
is UiText.DynamicString -> value
is UiText.StringResource -> stringResource(id = resId, formatArgs = args.toTypedArray())
is UiText.MultiLangString -> {
diff --git a/dachlatten-compose/src/test/kotlin/de/sipgate/dachlatten/compose/text/UiTextTest.kt b/dachlatten-compose/src/test/kotlin/de/sipgate/dachlatten/compose/text/UiTextTest.kt
index ca636fb..f74edf2 100644
--- a/dachlatten-compose/src/test/kotlin/de/sipgate/dachlatten/compose/text/UiTextTest.kt
+++ b/dachlatten-compose/src/test/kotlin/de/sipgate/dachlatten/compose/text/UiTextTest.kt
@@ -45,7 +45,7 @@ class UiTextTest {
assertThrows {
composeTestRule.setContent {
- uiText.asString()
+ uiText.resolve()
}
}
}
@@ -72,7 +72,7 @@ class UiTextTest {
private fun expectResolvedComposeString(expected: String, uiText: UiText, fallbackLocale: Locale? = null) {
composeTestRule.setContent {
- val resolvedString = uiText.asString(fallbackLocale)
+ val resolvedString = uiText.resolve(fallbackLocale)
/*
* This is needed because the Strings we have packaged with Robolectric