diff --git a/app/src/fdroid/res/values/strings.xml b/app/src/fdroid/res/values/strings.xml
index 1fe888d..abe9161 100644
--- a/app/src/fdroid/res/values/strings.xml
+++ b/app/src/fdroid/res/values/strings.xml
@@ -1,4 +1,4 @@
- GitLab
- "https://gitlab.com/sirekanyan.org/outline"
+ GitLab
+ "https://gitlab.com/sirekanyan.org/outline"
diff --git a/app/src/main/java/org/sirekanyan/outline/MainContent.kt b/app/src/main/java/org/sirekanyan/outline/MainContent.kt
index b7c492e..4f871ed 100644
--- a/app/src/main/java/org/sirekanyan/outline/MainContent.kt
+++ b/app/src/main/java/org/sirekanyan/outline/MainContent.kt
@@ -81,7 +81,7 @@ fun MainContent(state: MainState) {
TextButton(onClick = { state.dialog = AddServerDialog }) {
Icon(Icons.Default.Add, null)
Spacer(Modifier.size(8.dp))
- Text("Add server")
+ Text(stringResource(R.string.outln_text_add_server))
}
}
}
@@ -98,8 +98,12 @@ fun MainContent(state: MainState) {
listOf()
} else {
listOf(
- MenuItem("Sort by…", IconSort) { isSortingVisible = true },
- MenuItem("Search", Icons.Default.Search) { search.openSearch() },
+ MenuItem(R.string.outln_menu_sort, IconSort) {
+ isSortingVisible = true
+ },
+ MenuItem(R.string.outln_menu_search, Icons.Default.Search) {
+ search.openSearch()
+ },
)
}
MainTopAppBar(
@@ -173,15 +177,15 @@ fun MainContent(state: MainState) {
},
onMenuClick = state::openDrawer,
visibleItems = listOf(
- MenuItem("Sort by…", IconSort) {
+ MenuItem(R.string.outln_menu_sort, IconSort) {
isSortingVisible = true
},
),
overflowItems = listOf(
- MenuItem("Edit", Icons.Default.Edit) {
+ MenuItem(R.string.outln_menu_edit, Icons.Default.Edit) {
state.dialog = RenameServerDialog(page.server)
},
- MenuItem("Delete", Icons.Default.Delete) {
+ MenuItem(R.string.outln_menu_delete, Icons.Default.Delete) {
state.dialog = DeleteServerDialog(page.server)
},
),
diff --git a/app/src/main/java/org/sirekanyan/outline/MainTopAppBar.kt b/app/src/main/java/org/sirekanyan/outline/MainTopAppBar.kt
index b4fdca0..42a98ce 100644
--- a/app/src/main/java/org/sirekanyan/outline/MainTopAppBar.kt
+++ b/app/src/main/java/org/sirekanyan/outline/MainTopAppBar.kt
@@ -1,5 +1,6 @@
package org.sirekanyan.outline
+import androidx.annotation.StringRes
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Menu
import androidx.compose.material.icons.filled.MoreVert
@@ -19,9 +20,10 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.graphics.vector.ImageVector
+import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
-data class MenuItem(val text: String, val icon: ImageVector, val onClick: () -> Unit)
+data class MenuItem(@StringRes val text: Int, val icon: ImageVector, val onClick: () -> Unit)
@Composable
@OptIn(ExperimentalMaterial3Api::class)
@@ -57,7 +59,7 @@ private fun MainMenu(visibleItems: List