diff --git a/app/src/main/java/com/soulesidibe/todoapp/view/composables/create_todo.kt b/app/src/main/java/com/soulesidibe/todoapp/view/composables/create_todo.kt index dd1fbfe..91e85ae 100644 --- a/app/src/main/java/com/soulesidibe/todoapp/view/composables/create_todo.kt +++ b/app/src/main/java/com/soulesidibe/todoapp/view/composables/create_todo.kt @@ -10,11 +10,13 @@ import androidx.compose.material.icons.filled.Delete import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.navigation.NavHostController +import com.soulesidibe.todoapp.R import com.soulesidibe.todoapp.model.TodoViewModel import com.soulesidibe.todoapp.viewmodel.TodoDetailViewModel import com.soulesidibe.todoapp.viewmodel.ViewState @@ -53,7 +55,7 @@ private fun CreateTodoAppBar( ) { TopAppBar( title = { - Text(text = "Add a todo") + Text(text = stringResource(R.string.str_toolbar_title)) }, actions = { CreateTodoToolbarActions(todoId, onRemove) @@ -129,7 +131,7 @@ private fun CreateTodo( .fillMaxHeight() .fillMaxWidth() ) { - Text(text = "Veuillez fournir un titre a votre todo.") + Text(text = stringResource(R.string.str_add_todo_explanation)) Spacer(modifier = Modifier.height(8.dp)) val onClick: () -> Unit = { @@ -208,9 +210,9 @@ private fun CreateTodoSubmitButton( Button(modifier = modifier, onClick = onClick, enabled = !loadingState) { val label = if (todoState is ViewState.Success) { - "Modifier" + stringResource(R.string.btn_edit_todo) } else { - "Ajouter" + stringResource(R.string.btn_add_todo) } Text(text = label, textAlign = TextAlign.Center) } diff --git a/app/src/main/java/com/soulesidibe/todoapp/view/composables/list_of_todos.kt b/app/src/main/java/com/soulesidibe/todoapp/view/composables/list_of_todos.kt index 5c86276..cb9aee6 100644 --- a/app/src/main/java/com/soulesidibe/todoapp/view/composables/list_of_todos.kt +++ b/app/src/main/java/com/soulesidibe/todoapp/view/composables/list_of_todos.kt @@ -10,13 +10,13 @@ import androidx.compose.material.icons.filled.Add import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue -import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment.Companion.Center import androidx.compose.ui.Alignment.Companion.CenterHorizontally import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.layoutId import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontWeight @@ -123,7 +123,7 @@ fun TodosEmptyView(onAdd: () -> Unit) { Box( modifier = Modifier .fillMaxWidth() - .fillMaxHeight(), contentAlignment = Alignment.Center + .fillMaxHeight(), contentAlignment = Center ) { Column { @@ -134,11 +134,11 @@ fun TodosEmptyView(onAdd: () -> Unit) { contentDescription = "Empty todo list" ) Spacer(modifier = Modifier.height(8.dp)) - Text(text = "Vous n'avez pas encore de todo :(", color = Color.Gray) + Text(text = stringResource(R.string.str_no_todos), color = Color.Gray) Spacer(modifier = Modifier.height(16.dp)) Text( - text = "Ajouter un nouveau todo", + text = stringResource(R.string.str_add_todo), color = Color.Gray, modifier = Modifier .clickable { onAdd() } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b619faa..8a6195b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,9 @@ Todo App + Vous n\'avez pas encore de todo :( + Ajouter un nouveau todo + Modifier + Ajouter + Veuillez fournir un titre a votre todo. + Add a todo \ No newline at end of file