From 9648602e86cb68a21f2d50f4d198f9365b35805f Mon Sep 17 00:00:00 2001 From: VawnDao <134820492+VawnDao@users.noreply.github.com> Date: Sat, 30 Nov 2024 16:11:40 +0700 Subject: [PATCH] =?UTF-8?q?feat(language):=20=C4=91a=20ng=C3=B4n=20ng?= =?UTF-8?q?=E1=BB=AF=20(#84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Daocon <134820492+Daocon@users.noreply.github.com> Co-authored-by: Nguyễn Quang Minh (NQM) <94773751+nqmgaming@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../add_folder/AddFolderToClassScreen.kt | 6 +- .../component/AddFolderToClassItem.kt | 17 +-- .../component/AddFolderToClassList.kt | 10 +- .../component/AddFolderToClassTopAppBar.kt | 6 +- .../add_study_set/AddStudySetToClassScreen.kt | 6 +- .../component/AddStudySetToClassItem.kt | 19 ++-- .../component/AddStudySetToClassList.kt | 10 +- .../component/AddStudySetToClassTopAppBar.kt | 6 +- .../app/classes/create/CreateClassScreen.kt | 16 +-- .../app/classes/detail/ClassDetailScreen.kt | 24 ++-- .../component/ClassDetailBottomSheet.kt | 18 +-- .../component/InviteClassBottomSheet.kt | 13 ++- .../detail/members/MembersTabScreen.kt | 8 +- .../members/component/ClassMemberItem.kt | 8 +- .../detail/study_sets/StudySetsTabScreen.kt | 8 +- .../component/ClassDetailEmptyStudySet.kt | 4 +- .../app/classes/edit/EditClassScreen.kt | 16 +-- .../app/deeplink/classes/JoinClassScreen.kt | 16 +-- .../presentation/app/explore/ExploreScreen.kt | 8 +- .../CreateStudySetAITab.kt | 36 +++--- .../app/explore/top_streak/TopStreakScreen.kt | 16 ++- .../top_streak/component/TopStreakItem.kt | 8 +- .../flashcard/component/CardSelectImage.kt | 13 ++- .../flashcard/component/FlashCardTopAppBar.kt | 8 +- .../flashcard/create/CreateFlashCardArgs.kt | 2 - .../flashcard/create/CreateFlashCardScreen.kt | 5 +- .../create/draw/DrawFlashCardScreen.kt | 9 +- .../draw/component/SeekbarBrushWidth.kt | 4 +- .../app/flashcard/edit/EditFlashCardScreen.kt | 1 - .../AddStudySetToFolderScreen.kt | 4 +- .../component/AddStudySetToFolderList.kt | 8 +- .../component/AddStudySetToFolderTopAppBar.kt | 6 +- .../app/folder/create/CreateFolderScreen.kt | 14 ++- .../app/folder/edit/EditFolderScreen.kt | 14 ++- .../presentation/app/home/HomeScreen.kt | 18 +-- .../app/home/components/FolderHomeItem.kt | 2 +- .../app/home/components/StreakCalendar.kt | 3 +- .../SearchStudySetBySubjectScreen.kt | 2 +- .../presentation/app/profile/ProfileScreen.kt | 4 +- .../presentation/app/report/ReportScreen.kt | 5 +- .../app/search_result/SearchResultScreen.kt | 4 +- .../all_result/ListAllResultScreen.kt | 13 ++- .../all_result/component/SectionHeader.kt | 4 +- .../classes/ListResultClassesScreen.kt | 4 +- .../search_result/component/TopBarSearch.kt | 5 +- .../component/TopBarSearchResult.kt | 6 +- .../folder/ListResultFolderScreen.kt | 5 +- .../study_set/ListResultStudySetScreen.kt | 4 +- .../component/FilterStudySetBottomSheet.kt | 12 +- .../user/ListResultUserScreen.kt | 6 +- .../user/component/SearchUserResultItem.kt | 4 +- .../app/settings/SettingsScreen.kt | 2 +- .../SettingValidatePasswordBottomSheet.kt | 13 ++- .../ChangePasswordSettingScreen.kt | 10 +- .../email/UpdateEmailScreenSetting.kt | 6 +- .../full_name/UpdateFullNameSettingScreen.kt | 6 +- .../username/UpdateUsernameSettingScreen.kt | 6 +- .../app/user_detail/UserDetailScreen.kt | 2 +- .../presentation/auth/login/LoginScreen.kt | 4 +- app/src/main/res/values-vi/strings.xml | 102 ++++++++++++++++- app/src/main/res/values/strings.xml | 104 +++++++++++++++++- 61 files changed, 500 insertions(+), 223 deletions(-) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/AddFolderToClassScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/AddFolderToClassScreen.kt index a9c469cc..41f15526 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/AddFolderToClassScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/AddFolderToClassScreen.kt @@ -16,9 +16,11 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.pwhs.quickmem.R import com.pwhs.quickmem.domain.model.folder.GetFolderResponseModel import com.pwhs.quickmem.presentation.app.classes.add_folder.component.AddFolderToClassList import com.pwhs.quickmem.presentation.app.classes.add_folder.component.AddFolderToClassTopAppBar @@ -103,7 +105,7 @@ fun AddFolderToClass( AddFolderToClassTopAppBar( onDoneClick = onDoneClick, onNavigateCancel = onNavigateCancel, - title = "Add Folder" + title = stringResource(R.string.txt_add_folder) ) }, floatingActionButton = { @@ -114,7 +116,7 @@ fun AddFolderToClass( ) { Icon( imageVector = Icons.Default.Add, - contentDescription = "Create Folder" + contentDescription = stringResource(R.string.txt_create_folder) ) } } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassItem.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassItem.kt index 407fdc24..60190091 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassItem.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassItem.kt @@ -30,6 +30,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -42,7 +43,7 @@ import com.pwhs.quickmem.ui.theme.QuickMemTheme @Composable fun AddFolderToClassItem( modifier: Modifier = Modifier, - folder : GetFolderResponseModel, + folder: GetFolderResponseModel, isAdded: Boolean = false, onAddFolderToClass: (String) -> Unit = {}, ) { @@ -76,7 +77,7 @@ fun AddFolderToClassItem( ) { Icon( imageVector = Outlined.Folder, - contentDescription = "Folder Icon" + contentDescription = stringResource(R.string.txt_folder), ) Text( text = folder.title, @@ -90,9 +91,9 @@ fun AddFolderToClassItem( ) { Text( text = when (folder.studySetCount) { - 0 -> "No study sets" - 1 -> "1 study set" - else -> "${folder.studySetCount} study sets" + 0 -> stringResource(R.string.txt_no_study_sets) + 1 -> stringResource(R.string.txt_one_study_set) + else -> stringResource(R.string.txt_study_sets_library, folder.studySetCount) }, style = typography.bodyMedium ) @@ -109,7 +110,7 @@ fun AddFolderToClassItem( ) { AsyncImage( model = folder.owner.avatarUrl, - contentDescription = "User Avatar", + contentDescription = stringResource(R.string.txt_user_avatar), modifier = Modifier .size(24.dp) .clip(CircleShape), @@ -136,7 +137,9 @@ fun AddFolderToClassItem( ) { Icon( painter = painterResource(if (isAdded) R.drawable.ic_check_circle else R.drawable.ic_add_circle), - contentDescription = if (isAdded) "Check Icon" else "Add Icon", + contentDescription = if (isAdded) stringResource(R.string.txt_check_icon) else stringResource( + R.string.txt_add_icon + ), modifier = Modifier.size(26.dp), tint = colorScheme.onSurface ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassList.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassList.kt index f3bcd887..a3b5c977 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassList.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassList.kt @@ -24,12 +24,14 @@ import androidx.compose.ui.Alignment.Companion.CenterHorizontally import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import coil.compose.AsyncImage +import com.pwhs.quickmem.R import com.pwhs.quickmem.domain.model.folder.GetFolderResponseModel import com.pwhs.quickmem.presentation.ads.BannerAds import com.pwhs.quickmem.presentation.app.library.component.SearchTextField @@ -65,7 +67,7 @@ fun AddFolderToClassList( ) { AsyncImage( model = avatarUrl, - contentDescription = "User avatar", + contentDescription = stringResource(R.string.txt_user_avatar), modifier = Modifier .size(60.dp) .clip(CircleShape), @@ -83,7 +85,7 @@ fun AddFolderToClassList( color = colorScheme.onSurface.copy(alpha = 0.1f), ) Text( - text = "There are no folders yet, create one to get started!", + text = stringResource(R.string.txt_there_are_no_folders_yet_create_one_to_get_started), textAlign = TextAlign.Center, style = typography.bodyMedium.copy( color = colorScheme.onSurface.copy(alpha = 0.6f), @@ -102,7 +104,7 @@ fun AddFolderToClassList( SearchTextField( searchQuery = searchQuery, onSearchQueryChange = { searchQuery = it }, - placeholder = "Search folders", + placeholder = stringResource(R.string.txt_search_folders), ) } } @@ -124,7 +126,7 @@ fun AddFolderToClassList( horizontalAlignment = CenterHorizontally ) { Text( - text = "No folders found", + text = stringResource(R.string.txt_no_folders_found), style = typography.bodyLarge, textAlign = TextAlign.Center ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassTopAppBar.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassTopAppBar.kt index 1e6a97af..ff56169f 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassTopAppBar.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_folder/component/AddFolderToClassTopAppBar.kt @@ -14,9 +14,11 @@ import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.sp +import com.pwhs.quickmem.R import com.pwhs.quickmem.ui.theme.QuickMemTheme @OptIn(ExperimentalMaterial3Api::class) @@ -50,7 +52,7 @@ fun AddFolderToClassTopAppBar( ) ) { Text( - text = "Done", + text = stringResource(R.string.txt_done), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold, color = colorScheme.onSurface, @@ -67,7 +69,7 @@ fun AddFolderToClassTopAppBar( ) ) { Text( - text = "Cancel", + text = stringResource(R.string.txt_cancel), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold, color = colorScheme.onSurface, diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/AddStudySetToClassScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/AddStudySetToClassScreen.kt index f0516f15..fdb7c973 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/AddStudySetToClassScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/AddStudySetToClassScreen.kt @@ -16,9 +16,11 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.pwhs.quickmem.R import com.pwhs.quickmem.domain.model.study_set.GetStudySetResponseModel import com.pwhs.quickmem.presentation.app.classes.add_study_set.component.AddStudySetToClassList import com.pwhs.quickmem.presentation.app.classes.add_study_set.component.AddStudySetToClassTopAppBar @@ -103,7 +105,7 @@ fun AddStudySetToClass( AddStudySetToClassTopAppBar( onDoneClick = onDoneClick, onNavigateCancel = onNavigateCancel, - title = "Add Study Set" + title = stringResource(R.string.txt_add_study_set) ) }, floatingActionButton = { @@ -114,7 +116,7 @@ fun AddStudySetToClass( ) { Icon( imageVector = Icons.Default.Add, - contentDescription = "Create Study Set" + contentDescription = stringResource(R.string.txt_create_study_set) ) } } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassItem.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassItem.kt index 5bb35327..cbe0c4f1 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassItem.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassItem.kt @@ -16,7 +16,6 @@ import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults import androidx.compose.material3.Icon -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme.colorScheme import androidx.compose.material3.MaterialTheme.typography import androidx.compose.material3.Scaffold @@ -80,7 +79,7 @@ fun AddStudySetToClassItem( ) { Text( studySet.title, - style = MaterialTheme.typography.titleMedium.copy( + style = typography.titleMedium.copy( fontWeight = FontWeight.Bold ), maxLines = 2, @@ -93,14 +92,14 @@ fun AddStudySetToClassItem( Text( buildAnnotatedString { withStyle( - style = MaterialTheme.typography.bodySmall.toSpanStyle() + style = typography.bodySmall.toSpanStyle() .copy( fontWeight = FontWeight.Bold ) ) { append("${studySet.flashcardCount}") withStyle( - style = MaterialTheme.typography.bodySmall.toSpanStyle() + style = typography.bodySmall.toSpanStyle() .copy( fontWeight = FontWeight.Normal ) @@ -115,12 +114,12 @@ fun AddStudySetToClassItem( horizontalArrangement = Arrangement.spacedBy(8.dp), ) { Text( - text = studySet?.subject?.name ?: SubjectModel.defaultSubjects[0].name, + text = studySet.subject?.name ?: SubjectModel.defaultSubjects[0].name, style = typography.bodySmall.copy( color = colorScheme.onSurface.copy(alpha = 0.6f) ) ) - if(studySet?.isAIGenerated == true) { + if(studySet.isAIGenerated == true) { VerticalDivider( modifier = Modifier.height(12.dp) ) @@ -146,7 +145,7 @@ fun AddStudySetToClassItem( ) { AsyncImage( model = studySet.owner.avatarUrl, - contentDescription = "User avatar", + contentDescription = stringResource(R.string.txt_user_avatar), contentScale = ContentScale.Crop, modifier = Modifier .size(18.dp) @@ -154,7 +153,7 @@ fun AddStudySetToClassItem( ) Text( studySet.owner.username, - style = MaterialTheme.typography.bodySmall + style = typography.bodySmall ) } } @@ -170,7 +169,9 @@ fun AddStudySetToClassItem( ) { Icon( painter = painterResource(if (isAdded) R.drawable.ic_check_circle else R.drawable.ic_add_circle), - contentDescription = if (isAdded) "Check Icon" else "Add Icon", + contentDescription = if (isAdded) stringResource(R.string.txt_check_icon) else stringResource( + R.string.txt_add_icon + ), modifier = Modifier.size(26.dp), tint = colorScheme.onSurface ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassList.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassList.kt index 3508139a..6c25b9a1 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassList.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassList.kt @@ -24,12 +24,14 @@ import androidx.compose.ui.Alignment.Companion.CenterHorizontally import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import coil.compose.AsyncImage +import com.pwhs.quickmem.R import com.pwhs.quickmem.domain.model.color.ColorModel import com.pwhs.quickmem.domain.model.study_set.GetStudySetResponseModel import com.pwhs.quickmem.domain.model.subject.SubjectModel @@ -68,7 +70,7 @@ fun AddStudySetToClassList( ) { AsyncImage( model = avatarUrl, - contentDescription = "User avatar", + contentDescription = stringResource(R.string.txt_user_avatar), modifier = Modifier .size(60.dp) .clip(CircleShape), @@ -86,7 +88,7 @@ fun AddStudySetToClassList( color = colorScheme.onSurface.copy(alpha = 0.1f), ) Text( - text = "There are no owned study sets, create one to get started!", + text = stringResource(R.string.txt_there_are_no_owned_study_sets_create_one_to_get_started), textAlign = TextAlign.Center, style = typography.bodyMedium.copy( color = colorScheme.onSurface.copy(alpha = 0.6f), @@ -106,7 +108,7 @@ fun AddStudySetToClassList( SearchTextField( searchQuery = searchQuery, onSearchQueryChange = { searchQuery = it }, - placeholder = "Search study sets" + placeholder = stringResource(R.string.txt_search_study_sets), ) } @@ -119,7 +121,7 @@ fun AddStudySetToClassList( horizontalAlignment = CenterHorizontally ) { Text( - text = "No study set fold found", + text = stringResource(R.string.txt_no_study_set_folder_found), style = typography.bodyLarge, textAlign = TextAlign.Center ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassTopAppBar.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassTopAppBar.kt index ada4beb4..2c6101c2 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassTopAppBar.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/add_study_set/component/AddStudySetToClassTopAppBar.kt @@ -14,10 +14,12 @@ import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.sp import com.pwhs.quickmem.ui.theme.QuickMemTheme +import com.pwhs.quickmem.R @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -50,7 +52,7 @@ fun AddStudySetToClassTopAppBar( ) ) { Text( - text = "Done", + text = stringResource(R.string.txt_done), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold, color = colorScheme.onSurface, @@ -67,7 +69,7 @@ fun AddStudySetToClassTopAppBar( ) ) { Text( - text = "Cancel", + text = stringResource(R.string.txt_cancel), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold, color = colorScheme.onSurface, diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/create/CreateClassScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/create/CreateClassScreen.kt index 992a7650..232f5aa6 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/create/CreateClassScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/create/CreateClassScreen.kt @@ -11,9 +11,11 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.pwhs.quickmem.R import com.pwhs.quickmem.presentation.component.CreateTextField import com.pwhs.quickmem.presentation.component.CreateTopAppBar import com.pwhs.quickmem.presentation.component.LoadingOverlay @@ -107,7 +109,7 @@ fun CreateClass( CreateTopAppBar( onDoneClick = onDoneClick, onNavigateBack = onNavigateBack, - title = "Create new class" + title = stringResource(R.string.txt_create_new_class) ) } ) { innerPadding -> @@ -118,25 +120,25 @@ fun CreateClass( ) { CreateTextField( value = title, - title = "Class Title", + title = stringResource(R.string.txt_class_title), valueError = titleError, onValueChange = onTitleChange, - placeholder = "Enter Class Title" + placeholder = stringResource(R.string.txt_enter_class_title) ) CreateTextField( value = description, - title = "Description (Optional)", + title = stringResource(R.string.txt_description_optional), valueError = descriptionError, onValueChange = onDescriptionChange, - placeholder = "Enter Class Description" + placeholder = stringResource(R.string.txt_enter_class_description) ) SwitchContainer( - text = "Allow class members to send invites to other people", + text = stringResource(R.string.txt_allow_class_members_to_send_invites_to_other_people), checked = allowMemberManagement, onCheckedChange = onAllowMemberManagementChange ) SwitchContainer( - text = "Allow class members to add study set and folders", + text = stringResource(R.string.txt_allow_class_members_to_add_study_set_and_folders), checked = allowSetManagement, onCheckedChange = onAllowSetManagementChange ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/ClassDetailScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/ClassDetailScreen.kt index 9a339d74..9d98153d 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/ClassDetailScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/ClassDetailScreen.kt @@ -30,6 +30,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.hilt.navigation.compose.hiltViewModel @@ -63,6 +64,7 @@ import com.ramcosta.composedestinations.result.NavResult import com.ramcosta.composedestinations.result.ResultBackNavigator import com.ramcosta.composedestinations.result.ResultRecipient import timber.log.Timber +import com.pwhs.quickmem.R @Composable @Destination( @@ -333,8 +335,12 @@ fun ClassDetail( onDeleteStudySetClick: (String) -> Unit = {}, onDeleteFolderClick: (String) -> Unit = {}, ) { + val tabTitles = listOf( + stringResource(id = R.string.txt_study_sets), + stringResource(id = R.string.txt_folders), + stringResource(R.string.txt_members) + ) var tabIndex by rememberSaveable { mutableIntStateOf(0) } - val tabTitles = listOf("Study sets", "Folders", "Members") val refreshState = rememberPullToRefreshState() var showMoreBottomSheet by remember { mutableStateOf(false) } @@ -452,10 +458,10 @@ fun ClassDetail( onDeleteClass() showDeleteConfirmationDialog = false }, - title = "Delete class", - text = "Are you sure you want to delete this class?", - confirmButtonTitle = "Delete", - dismissButtonTitle = "Cancel", + title = stringResource(id = R.string.txt_delete_class), + text = stringResource(R.string.txt_are_you_sure_you_want_to_delete_this_class), + confirmButtonTitle = stringResource(R.string.txt_delete), + dismissButtonTitle = stringResource(R.string.txt_cancel), ) } @@ -468,10 +474,10 @@ fun ClassDetail( onExitClass() showExitConfirmationDialog = false }, - title = "Exit Class", - text = "Are you sure you want to exit this class?", - confirmButtonTitle = "Exit", - dismissButtonTitle = "Cancel", + title = stringResource(id = R.string.txt_exit_class), + text = stringResource(R.string.txt_are_you_sure_you_want_to_exit_this_class), + confirmButtonTitle = stringResource(R.string.txt_exit), + dismissButtonTitle = stringResource(R.string.txt_cancel), ) } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/component/ClassDetailBottomSheet.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/component/ClassDetailBottomSheet.kt index ebf6521c..040dcb93 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/component/ClassDetailBottomSheet.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/component/ClassDetailBottomSheet.kt @@ -20,6 +20,8 @@ import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource +import com.pwhs.quickmem.R import com.pwhs.quickmem.presentation.app.study_set.detail.component.ItemMenuBottomSheet @OptIn(ExperimentalMaterial3Api::class) @@ -55,19 +57,19 @@ fun ClassDetailBottomSheet( ItemMenuBottomSheet( onClick = onAddStudySetToClass, icon = Outlined.ContentCopy, - title = "Add study set to class" + title = stringResource(R.string.txt_add_study_set_to_class) ) ItemMenuBottomSheet( onClick = onAddFolderToClass, icon = Outlined.Folder, - title = "Add folder to class" + title = stringResource(R.string.txt_add_folder_to_class) ) } if (isOwner) { ItemMenuBottomSheet( onClick = onEditClass, icon = Outlined.Edit, - title = "Edit Class" + title = stringResource(R.string.txt_edit_class) ) } @@ -75,28 +77,28 @@ fun ClassDetailBottomSheet( ItemMenuBottomSheet( onClick = onJoinClass, icon = Outlined.GroupAdd, - title = "Join Class" + title = stringResource(R.string.txt_join_class) ) } if (isOwner) { ItemMenuBottomSheet( onClick = onInviteClass, icon = Default.PersonAdd, - title = "Invite Member" + title = stringResource(R.string.txt_invite_member) ) } if (!isOwner && isMember) { ItemMenuBottomSheet( onClick = onExitClass, icon = Icons.AutoMirrored.Filled.ExitToApp, - title = "Exit Class", + title = stringResource(R.string.txt_exit_class), ) } if (isOwner) { ItemMenuBottomSheet( onClick = onDeleteClass, icon = Default.DeleteOutline, - title = "Delete Class", + title = stringResource(R.string.txt_delete_class), color = Color.Red ) } @@ -104,7 +106,7 @@ fun ClassDetailBottomSheet( ItemMenuBottomSheet( onClick = onReportClass, icon = Outlined.Report, - title = "Report Class" + title = stringResource(R.string.txt_report_class) ) } } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/component/InviteClassBottomSheet.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/component/InviteClassBottomSheet.kt index 7b764c17..4d00ff8e 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/component/InviteClassBottomSheet.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/component/InviteClassBottomSheet.kt @@ -16,8 +16,10 @@ import androidx.compose.material3.Text import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp +import com.pwhs.quickmem.R @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -43,13 +45,13 @@ fun InviteClassBottomSheet( .padding(16.dp) ) { Text( - text = "Invite Members", + text = stringResource(R.string.txt_invite_members), style = typography.titleLarge.copy( fontWeight = FontWeight.Bold ) ) Text( - text = "To invite members to this class, add their Quizlet usernames below.", + text = stringResource(R.string.txt_to_invite_members_to_this_class_add_their_quickmem_usernames_below), style = typography.bodyMedium, modifier = Modifier.padding(top = 8.dp) ) @@ -58,7 +60,7 @@ fun InviteClassBottomSheet( value = username, onValueChange = onUsernameChanged, errorMessage = errorMessage, - placeholder = "Type username to invite", + placeholder = stringResource(R.string.txt_type_username_to_invite), ) Button( enabled = username.isNotEmpty() && username.length > 4, @@ -68,7 +70,8 @@ fun InviteClassBottomSheet( shape = shapes.medium ) { Text( - text = "Submit", style = typography.bodyMedium.copy( + text = stringResource(R.string.txt_submit), + style = typography.bodyMedium.copy( fontWeight = FontWeight.Bold ) ) @@ -84,7 +87,7 @@ fun InviteClassBottomSheet( shape = shapes.medium ) { Text( - text = "Cancel", + text = stringResource(R.string.txt_cancel), style = typography.bodyMedium.copy( fontWeight = FontWeight.Bold ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/members/MembersTabScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/members/MembersTabScreen.kt index 34dea048..4932109e 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/members/MembersTabScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/members/MembersTabScreen.kt @@ -8,8 +8,10 @@ import androidx.compose.foundation.lazy.items import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.pwhs.quickmem.R import com.pwhs.quickmem.domain.model.users.ClassMemberModel import com.pwhs.quickmem.presentation.app.classes.detail.component.ClassDetailEmpty import com.pwhs.quickmem.presentation.app.classes.detail.members.component.ClassMemberItem @@ -33,9 +35,9 @@ fun MembersTabScreen( member.isEmpty() -> { ClassDetailEmpty( modifier = Modifier.padding(innerPadding), - title = "This class has no members", - subtitle = "Add members to share them with your class.", - buttonTitle = "Add Members", + title = stringResource(R.string.txt_this_class_has_no_members), + subtitle = stringResource(R.string.txt_add_members_to_share_them_with_your_class), + buttonTitle = stringResource(R.string.txt_add_members), onAddClick = onAddMembersClicked, isOwner = isOwner ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/members/component/ClassMemberItem.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/members/component/ClassMemberItem.kt index 25cd3db6..5cb81956 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/members/component/ClassMemberItem.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/members/component/ClassMemberItem.kt @@ -25,6 +25,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview @@ -33,6 +34,7 @@ import coil.compose.AsyncImage import com.pwhs.quickmem.domain.model.users.ClassMemberModel import com.pwhs.quickmem.ui.theme.QuickMemTheme import com.pwhs.quickmem.util.upperCaseFirstLetter +import com.pwhs.quickmem.R @Composable fun ClassMemberItem( @@ -73,7 +75,7 @@ fun ClassMemberItem( ) { AsyncImage( model = classMemberModel.avatarUrl, - contentDescription = "avatar", + contentDescription = stringResource(id = R.string.txt_avatar), contentScale = ContentScale.Crop, modifier = Modifier .size(30.dp) @@ -98,7 +100,7 @@ fun ClassMemberItem( if (classMemberModel.isOwner) { Text( - text = "Owner", + text = stringResource(R.string.txt_owner), style = typography.bodySmall.copy( color = colorScheme.primary ), @@ -113,7 +115,7 @@ fun ClassMemberItem( ) { Icon( imageVector = Icons.Rounded.Clear, - contentDescription = "delete", + contentDescription = stringResource(R.string.txt_delete), modifier = Modifier .size(24.dp) ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/study_sets/StudySetsTabScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/study_sets/StudySetsTabScreen.kt index 838f7737..799f0515 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/study_sets/StudySetsTabScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/study_sets/StudySetsTabScreen.kt @@ -8,8 +8,10 @@ import androidx.compose.foundation.lazy.items import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.pwhs.quickmem.R import com.pwhs.quickmem.domain.model.study_set.GetStudySetResponseModel import com.pwhs.quickmem.presentation.app.classes.detail.study_sets.component.ClassDetailEmptyStudySet import com.pwhs.quickmem.presentation.app.library.study_set.component.StudySetItem @@ -34,9 +36,9 @@ fun StudySetsTabScreen( studySets.isEmpty() -> { ClassDetailEmptyStudySet( modifier = Modifier.padding(innerPadding), - title = "This class has no sets", - subtitle = "Add flashcard sets to share them with your class.", - buttonTitle = "Add study sets", + title = stringResource(R.string.txt_this_class_has_no_sets), + subtitle = stringResource(R.string.txt_add_flashcard_sets_to_share_them_with_your_class), + buttonTitle = stringResource(R.string.txt_add_study_sets), onAddStudySetClicked = onAddStudySetClicked, isOwner = isOwner ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/study_sets/component/ClassDetailEmptyStudySet.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/study_sets/component/ClassDetailEmptyStudySet.kt index eef6a1be..ca4f1a79 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/study_sets/component/ClassDetailEmptyStudySet.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/detail/study_sets/component/ClassDetailEmptyStudySet.kt @@ -16,10 +16,12 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight.Companion.Bold import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.pwhs.quickmem.R import com.pwhs.quickmem.ui.theme.QuickMemTheme @Composable @@ -64,7 +66,7 @@ fun ClassDetailEmptyStudySet( ) { Icon( Icons.Filled.Add, - contentDescription = "Add new study set to class", + contentDescription = stringResource(R.string.txt_add_new_study_set_to_class), tint = colorScheme.background, modifier = Modifier.padding(end = 8.dp) ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/edit/EditClassScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/edit/EditClassScreen.kt index 72fd00ce..cbe9f093 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/edit/EditClassScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/classes/edit/EditClassScreen.kt @@ -13,9 +13,11 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.pwhs.quickmem.R import com.pwhs.quickmem.presentation.component.CreateTextField import com.pwhs.quickmem.presentation.component.CreateTopAppBar import com.pwhs.quickmem.presentation.component.LoadingOverlay @@ -102,7 +104,7 @@ fun EditClass( CreateTopAppBar( onNavigateBack = onNavigateBack, onDoneClick = onDoneClick, - title = "Edit this class" + title = stringResource(R.string.txt_edit_this_class) ) } ) { innerPadding -> @@ -114,25 +116,25 @@ fun EditClass( ) { CreateTextField( value = title, - title = "Folder Title", + title = stringResource(R.string.txt_folder_title), valueError = titleError, onValueChange = onTitleChange, - placeholder = "Enter Folder Title" + placeholder = stringResource(R.string.txt_enter_folder_title) ) CreateTextField( value = description, - title = "Description (Optional)", + title = stringResource(R.string.txt_description_optional), valueError = descriptionError, onValueChange = onDescriptionChange, - placeholder = "Enter Description" + placeholder = stringResource(R.string.txt_enter_description) ) SwitchContainer( - text = "Allow class members to send invites to other people", + text = stringResource(R.string.txt_allow_class_members_to_send_invites_to_other_people), checked = allowMemberManagement, onCheckedChange = onAllowMemberManagementChange ) SwitchContainer( - text = "Allow class members to add study set and folders", + text = stringResource(R.string.txt_allow_class_members_to_add_study_set_and_folders), checked = allowSetManagement, onCheckedChange = onAllowSetManagementChange ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/deeplink/classes/JoinClassScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/deeplink/classes/JoinClassScreen.kt index fd3929fd..86dd1fdf 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/deeplink/classes/JoinClassScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/deeplink/classes/JoinClassScreen.kt @@ -31,6 +31,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import coil.compose.AsyncImage @@ -52,6 +53,7 @@ import com.revenuecat.purchases.Purchases import com.revenuecat.purchases.PurchasesError import com.revenuecat.purchases.interfaces.ReceiveCustomerInfoCallback import timber.log.Timber +import com.pwhs.quickmem.R @Destination( navArgs = JoinClassArgs::class @@ -155,14 +157,14 @@ fun JoinClass( Scaffold( topBar = { CenterAlignedTopAppBar( - title = { Text("Join Class") }, + title = { Text(stringResource(R.string.txt_join_class)) }, navigationIcon = { IconButton( onClick = onBackHome ) { Icon( imageVector = Icons.AutoMirrored.Filled.ArrowBack, - contentDescription = "Back", + contentDescription = stringResource(R.string.txt_back), tint = Color.Gray.copy(alpha = 0.6f) ) } @@ -178,7 +180,7 @@ fun JoinClass( horizontalAlignment = Alignment.CenterHorizontally, ) { item { - SettingTitleSection("Class Detail") + SettingTitleSection(stringResource(R.string.txt_class_detail)) SettingCard { Column( modifier = Modifier.padding(16.dp) @@ -191,7 +193,7 @@ fun JoinClass( if (classDetailResponseModel?.description?.isNotEmpty() == true) { HorizontalDivider() SettingItem( - title = "Description", + title = stringResource(R.string.txt_description), subtitle = classDetailResponseModel.description, showArrow = false ) @@ -201,7 +203,7 @@ fun JoinClass( } item { - SettingTitleSection("Owner") + SettingTitleSection(stringResource(R.string.txt_owner)) SettingCard( onClick = onOwnerClick ) { @@ -216,7 +218,7 @@ fun JoinClass( ) AsyncImage( model = classDetailResponseModel?.owner?.avatarUrl ?: "", - contentDescription = "Class Image", + contentDescription = stringResource(R.string.txt_class_image), modifier = Modifier .padding(end = 16.dp) .size(20.dp) @@ -237,7 +239,7 @@ fun JoinClass( }, modifier = Modifier.padding(16.dp) ) { - Text(text = "Join Class") + Text(text = stringResource(R.string.txt_join_class)) } } item { diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/ExploreScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/ExploreScreen.kt index 04476fcd..2902accd 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/ExploreScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/ExploreScreen.kt @@ -30,7 +30,6 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf -import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment @@ -39,6 +38,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -158,8 +158,8 @@ fun Explore( ) { var tabIndex by rememberSaveable { mutableIntStateOf(0) } val tabTitles = listOf( - "Create Study Set AI", - "Top Streak", + stringResource(R.string.txt_create_study_set_ai), + stringResource(R.string.txt_top_streak), ) val context = LocalContext.current @@ -169,7 +169,7 @@ fun Explore( CenterAlignedTopAppBar( title = { Text( - text = "Explore", + text = stringResource(R.string.txt_explore), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/create_study_set_ai/CreateStudySetAITab.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/create_study_set_ai/CreateStudySetAITab.kt index 8d763109..26210fe0 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/create_study_set_ai/CreateStudySetAITab.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/create_study_set_ai/CreateStudySetAITab.kt @@ -87,10 +87,10 @@ fun CreateStudySetAITab( ) { Icon( painter = painterResource(R.drawable.ic_sparkling), - contentDescription = "Create", + contentDescription = stringResource(R.string.txt_create), ) Text( - text = "Create", + text = stringResource(R.string.txt_create), style = typography.bodyMedium.copy( fontWeight = FontWeight.Bold ) @@ -111,7 +111,7 @@ fun CreateStudySetAITab( modifier = Modifier.padding(bottom = 8.dp) ) { Text( - text = "Warning: AI may not generate accurate or complete flashcards. Please review if unsure.", + text = stringResource(R.string.txt_warning_ai_not_gen), color = Color.Red, style = typography.bodyMedium.copy(fontWeight = FontWeight.Bold), textAlign = TextAlign.Start, @@ -146,7 +146,7 @@ fun CreateStudySetAITab( onValueChange = onTitleChange, placeholder = { Text( - text = "Title (required)", + text = stringResource(R.string.txt_title_required), style = typography.bodyMedium, ) } @@ -164,7 +164,7 @@ fun CreateStudySetAITab( onValueChange = onDescriptionChange, placeholder = { Text( - text = "Description (optional)", + text = stringResource(R.string.txt_description_optional), style = typography.bodyMedium, ) }, @@ -181,7 +181,7 @@ fun CreateStudySetAITab( } item { Text( - text = "Number of flashcards (optional)", + text = stringResource(R.string.txt_number_of_flashcards_optional), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold ), @@ -280,7 +280,7 @@ fun CreateStudySetAITab( verticalAlignment = Alignment.CenterVertically ) { Text( - text = "Language", + text = stringResource(R.string.txt_language), style = typography.bodyMedium.copy( fontWeight = FontWeight.Bold ) @@ -306,7 +306,7 @@ fun CreateStudySetAITab( } item { Text( - text = "Question type", + text = stringResource(R.string.txt_question_type), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold ), @@ -333,7 +333,7 @@ fun CreateStudySetAITab( .fillMaxWidth() .padding(horizontal = 8.dp) ) { - Text(text = "Multiple choice") + Text(text = stringResource(R.string.txt_multiple_choice)) Spacer(modifier = Modifier.weight(1f)) RadioButton( selected = questionType == QuestionType.MULTIPLE_CHOICE, @@ -347,7 +347,7 @@ fun CreateStudySetAITab( .fillMaxWidth() .padding(horizontal = 8.dp) ) { - Text(text = "True/False") + Text(text = stringResource(R.string.txt_true_false)) Spacer(modifier = Modifier.weight(1f)) RadioButton( selected = questionType == QuestionType.TRUE_FALSE, @@ -360,7 +360,7 @@ fun CreateStudySetAITab( item { Text( - text = "Difficulty level", + text = stringResource(R.string.txt_difficulty_level), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold ), @@ -386,7 +386,7 @@ fun CreateStudySetAITab( .fillMaxWidth() .padding(horizontal = 8.dp) ) { - Text(text = "Easy") + Text(text = stringResource(R.string.txt_easy)) Spacer(modifier = Modifier.weight(1f)) RadioButton( selected = difficultyLevel == DifficultyLevel.EASY, @@ -400,7 +400,7 @@ fun CreateStudySetAITab( .fillMaxWidth() .padding(horizontal = 8.dp) ) { - Text(text = "Medium") + Text(text = stringResource(R.string.txt_medium)) Spacer(modifier = Modifier.weight(1f)) RadioButton( selected = difficultyLevel == DifficultyLevel.MEDIUM, @@ -414,7 +414,7 @@ fun CreateStudySetAITab( .fillMaxWidth() .padding(horizontal = 8.dp) ) { - Text(text = "Hard") + Text(text = stringResource(R.string.txt_hard)) Spacer(modifier = Modifier.weight(1f)) RadioButton( selected = difficultyLevel == DifficultyLevel.HARD, @@ -462,7 +462,7 @@ fun CreateStudySetAITab( ) { Image( painter = painterResource(id = R.drawable.ic_vn_flag), - contentDescription = "VN Flag", + contentDescription = stringResource(R.string.txt_vn_flag), modifier = Modifier .size(24.dp) ) @@ -481,7 +481,7 @@ fun CreateStudySetAITab( if (language == LanguageCode.VI.code) { Icon( imageVector = Icons.Default.Check, - contentDescription = "Check", + contentDescription = stringResource(R.string.txt_check), tint = colorScheme.primary ) } @@ -502,7 +502,7 @@ fun CreateStudySetAITab( ) { Image( painter = painterResource(id = R.drawable.ic_us_flag), - contentDescription = "US Flag", + contentDescription = stringResource(R.string.txt_us_flag), modifier = Modifier .size(24.dp) ) @@ -522,7 +522,7 @@ fun CreateStudySetAITab( if (language == LanguageCode.EN.code) { Icon( imageVector = Icons.Default.Check, - contentDescription = "Check", + contentDescription = stringResource(R.string.txt_check), tint = colorScheme.primary ) } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/top_streak/TopStreakScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/top_streak/TopStreakScreen.kt index 166e7fae..42852c3a 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/top_streak/TopStreakScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/top_streak/TopStreakScreen.kt @@ -26,6 +26,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview @@ -86,25 +87,28 @@ fun TopStreakScreen( ) { Image( painter = painterResource(id = R.drawable.top2), - contentDescription = "Silver Medal", + contentDescription = stringResource(R.string.txt_silver_medal), modifier = Modifier.size(with(density) { silverSize.value.toDp() }) ) Image( painter = painterResource(id = R.drawable.top1), - contentDescription = "Gold Medal", + contentDescription = stringResource(R.string.txt_gold_medal), modifier = Modifier.size(with(density) { goldSize.value.toDp() }) ) Image( painter = painterResource(id = R.drawable.top3), - contentDescription = "Bronze Medal", + contentDescription = stringResource(R.string.txt_bronze_medal), modifier = Modifier.size(with(density) { bronzeSize.value.toDp() }) ) } val message = when (rankOwner) { - in 1..3 -> "You have reached the top #$rankOwner on the Top Streak leaderboard!" - in 4..10 -> "Keep up the streak to climb the leaderboard!" - else -> "Top 10 highest streak leaderboard" + in 1..3 -> stringResource( + R.string.txt_you_have_reached_the_top_on_the_top_streak_leaderboard, + rankOwner.toString() + ) + in 4..10 -> stringResource(R.string.txt_streak_leaderboard_motivation) + else -> stringResource(R.string.txt_top_10_highest_streak_leaderboard) } Text( diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/top_streak/component/TopStreakItem.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/top_streak/component/TopStreakItem.kt index f8ecddb4..ac81ebd4 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/top_streak/component/TopStreakItem.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/explore/top_streak/component/TopStreakItem.kt @@ -55,19 +55,19 @@ fun StreakItem( when (rank) { 1 -> Image( painter = painterResource(id = R.drawable.top1), - contentDescription = "Gold Medal", + contentDescription = stringResource(R.string.txt_gold_medal), modifier = Modifier.size(32.dp) ) 2 -> Image( painter = painterResource(id = R.drawable.top2), - contentDescription = "Silver Medal", + contentDescription = stringResource(R.string.txt_silver_medal), modifier = Modifier.size(32.dp) ) 3 -> Image( painter = painterResource(id = R.drawable.top3), - contentDescription = "Bronze Medal", + contentDescription = stringResource(R.string.txt_bronze_medal), modifier = Modifier.size(32.dp) ) @@ -85,7 +85,7 @@ fun StreakItem( AsyncImage( model = topStreak.avatarUrl, - contentDescription = "User Avatar", + contentDescription = stringResource(R.string.txt_user_avatar), contentScale = ContentScale.Crop, modifier = Modifier .size(40.dp) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/component/CardSelectImage.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/component/CardSelectImage.kt index 35f22b15..ef4b6293 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/component/CardSelectImage.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/component/CardSelectImage.kt @@ -29,6 +29,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog import coil.compose.AsyncImage @@ -80,7 +81,7 @@ fun CardSelectImage( Timber.d("Image Url: $definitionImageUrl") AsyncImage( model = definitionImageUrl, - contentDescription = "Image for definition", + contentDescription = stringResource(R.string.txt_image_for_definition), modifier = Modifier.size(120.dp), contentScale = ContentScale.Crop ) @@ -88,7 +89,7 @@ fun CardSelectImage( Timber.d("Image Uri: $definitionImageUri") AsyncImage( model = definitionImageUri, - contentDescription = "Image for definition", + contentDescription = stringResource(R.string.txt_image_for_definition), modifier = Modifier.size(120.dp), contentScale = ContentScale.Crop, onSuccess = { onUploadImage(definitionImageUri) } @@ -97,7 +98,7 @@ fun CardSelectImage( Timber.d("No Image") Image( painter = painterResource(id = R.drawable.ic_add_image), - contentDescription = "Add Image to Definition", + contentDescription = stringResource(R.string.txt_add_image_to_definition), modifier = Modifier.size(120.dp), colorFilter = ColorFilter.tint( MaterialTheme.colorScheme.onSurface.copy( @@ -108,7 +109,7 @@ fun CardSelectImage( ) } Text( - "Image for definition", + stringResource(R.string.txt_image_for_definition), color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.5f), modifier = Modifier.padding(top = 8.dp) ) @@ -132,7 +133,7 @@ fun CardSelectImage( Column(horizontalAlignment = Alignment.CenterHorizontally) { AsyncImage( model = definitionImageUri ?: definitionImageUrl, - contentDescription = "Full Image", + contentDescription = stringResource(R.string.txt_full_image), modifier = Modifier .fillMaxWidth() .padding(16.dp), @@ -146,7 +147,7 @@ fun CardSelectImage( }, colors = ButtonDefaults.buttonColors(MaterialTheme.colorScheme.error) ) { - Text("Delete Image") + Text(stringResource(R.string.txt_delete_image)) } } } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/component/FlashCardTopAppBar.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/component/FlashCardTopAppBar.kt index 20062664..242655c6 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/component/FlashCardTopAppBar.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/component/FlashCardTopAppBar.kt @@ -13,7 +13,9 @@ import androidx.compose.material3.MaterialTheme.typography import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight +import com.pwhs.quickmem.R @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -37,12 +39,12 @@ fun FlashCardTopAppBar( }, navigationIcon = { IconButton(onClick = onNavigationBack) { - Icon(imageVector = Icons.Filled.Clear, contentDescription = "Back") + Icon(imageVector = Icons.Filled.Clear, contentDescription = stringResource(R.string.txt_back)) } }, actions = { IconButton(onClick = onSettingsClicked) { - Icon(imageVector = Icons.Default.Settings, contentDescription = "Settings") + Icon(imageVector = Icons.Default.Settings, contentDescription = stringResource(R.string.txt_settings)) } IconButton( onClick = onSaveFlashCardClicked, @@ -50,7 +52,7 @@ fun FlashCardTopAppBar( ) { Icon( imageVector = Icons.Filled.Done, - contentDescription = "Save", + contentDescription = stringResource(R.string.txt_save), tint = if (enableSaveButton) { colorScheme.primary } else { diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/CreateFlashCardArgs.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/CreateFlashCardArgs.kt index cc6ec61f..61952d2e 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/CreateFlashCardArgs.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/CreateFlashCardArgs.kt @@ -1,7 +1,5 @@ package com.pwhs.quickmem.presentation.app.flashcard.create -import android.net.Uri - data class CreateFlashCardArgs ( val studySetId: String, val studySetTitle: String diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/CreateFlashCardScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/CreateFlashCardScreen.kt index 2a72264b..414fe3b8 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/CreateFlashCardScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/CreateFlashCardScreen.kt @@ -315,7 +315,7 @@ fun CreateFlashCard( ) { Icon( imageVector = Icons.Filled.Clear, - contentDescription = "Close", + contentDescription = stringResource(R.string.txt_close), ) } } @@ -359,7 +359,7 @@ fun CreateFlashCard( ) { Icon( imageVector = Icons.Filled.Clear, - contentDescription = "Close", + contentDescription = stringResource(R.string.txt_close), ) } } @@ -425,7 +425,6 @@ fun CreateFlashCard( title = stringResource(R.string.txt_draw_to_answer), icon = R.drawable.ic_art, onClick = { - //TODO: Draw showBottomSheetSetting = false }, ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/draw/DrawFlashCardScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/draw/DrawFlashCardScreen.kt index 3b063663..66055373 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/draw/DrawFlashCardScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/draw/DrawFlashCardScreen.kt @@ -35,8 +35,10 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clipToBounds import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.asAndroidBitmap +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp +import com.pwhs.quickmem.R import com.pwhs.quickmem.presentation.app.flashcard.create.draw.component.ControlsBar import com.pwhs.quickmem.presentation.app.flashcard.create.draw.component.SeekbarBrushWidth import com.pwhs.quickmem.util.convertToOldColor @@ -51,7 +53,6 @@ import io.ak1.rangvikalp.defaultSelectedColor import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.delay import kotlinx.coroutines.launch -import kotlinx.coroutines.withContext import timber.log.Timber @Destination @@ -111,7 +112,7 @@ fun DrawFlashCard( CenterAlignedTopAppBar( title = { Text( - text = "Draw", style = typography.titleMedium.copy( + text = stringResource(R.string.txt_draw), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold ) ) @@ -122,7 +123,7 @@ fun DrawFlashCard( ) { Icon( imageVector = Icons.Default.Clear, - contentDescription = "Cancel and back", + contentDescription = stringResource(R.string.txt_cancel_and_back), ) } }, @@ -144,7 +145,7 @@ fun DrawFlashCard( tint = colorScheme.primary ) Text( - text = "Save", + text = stringResource(R.string.txt_save), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold, color = colorScheme.primary diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/draw/component/SeekbarBrushWidth.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/draw/component/SeekbarBrushWidth.kt index 0fb282d4..96c4d5d6 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/draw/component/SeekbarBrushWidth.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/create/draw/component/SeekbarBrushWidth.kt @@ -20,10 +20,12 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp import androidx.compose.ui.viewinterop.AndroidView import androidx.core.graphics.BlendModeColorFilterCompat import androidx.core.graphics.BlendModeCompat +import com.pwhs.quickmem.R @Composable fun SeekbarBrushWidth( @@ -63,7 +65,7 @@ fun SeekbarBrushWidth( horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically ) { - Text(text = "Stroke Width") + Text(text = stringResource(R.string.txt_stroke_width)) Text(text = "$progress pt") } AndroidView( diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/edit/EditFlashCardScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/edit/EditFlashCardScreen.kt index bcb37218..d863a9c0 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/edit/EditFlashCardScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/flashcard/edit/EditFlashCardScreen.kt @@ -429,7 +429,6 @@ fun CreateFlashCard( title = stringResource(R.string.txt_draw_to_answer), icon = R.drawable.ic_art, onClick = { - //TODO: Draw showBottomSheetSetting = false }, ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/AddStudySetToFolderScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/AddStudySetToFolderScreen.kt index 5f65508a..8a776da9 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/AddStudySetToFolderScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/AddStudySetToFolderScreen.kt @@ -16,6 +16,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.collectAsState import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel @@ -28,6 +29,7 @@ import com.ramcosta.composedestinations.annotation.RootGraph import com.ramcosta.composedestinations.generated.destinations.CreateStudySetScreenDestination import com.ramcosta.composedestinations.navigation.DestinationsNavigator import com.ramcosta.composedestinations.result.ResultBackNavigator +import com.pwhs.quickmem.R @Destination( navArgs = AddStudySetToFolderArgs::class @@ -103,7 +105,7 @@ fun AddStudySetToFolder( AddStudySetToFolderTopAppBar( onDoneClick = onDoneClick, onNavigateCancel = onNavigateCancel, - title = "Add Study Set" + title = stringResource(id = R.string.txt_add_study_set) ) }, floatingActionButton = { diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/component/AddStudySetToFolderList.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/component/AddStudySetToFolderList.kt index ada9efc2..e277e7a2 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/component/AddStudySetToFolderList.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/component/AddStudySetToFolderList.kt @@ -24,12 +24,14 @@ import androidx.compose.ui.Alignment.Companion.CenterHorizontally import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import coil.compose.AsyncImage +import com.pwhs.quickmem.R import com.pwhs.quickmem.domain.model.color.ColorModel import com.pwhs.quickmem.domain.model.study_set.GetStudySetResponseModel import com.pwhs.quickmem.domain.model.subject.SubjectModel @@ -86,7 +88,7 @@ fun AddStudySetToFolderList( color = colorScheme.onSurface.copy(alpha = 0.1f), ) Text( - text = "There are no owned study sets, create one to get started!", + text = stringResource(id = R.string.txt_there_are_no_owned_study_sets_create_one_to_get_started), textAlign = TextAlign.Center, style = typography.bodyMedium.copy( color = colorScheme.onSurface.copy(alpha = 0.6f), @@ -106,7 +108,7 @@ fun AddStudySetToFolderList( SearchTextField( searchQuery = searchQuery, onSearchQueryChange = { searchQuery = it }, - placeholder = "Search study sets" + placeholder = stringResource(id = R.string.txt_search_study_sets), ) } @@ -119,7 +121,7 @@ fun AddStudySetToFolderList( horizontalAlignment = CenterHorizontally ) { Text( - text = "No study set fold found", + text = stringResource(id = R.string.txt_no_study_set_folder_found), style = typography.bodyLarge, textAlign = TextAlign.Center ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/component/AddStudySetToFolderTopAppBar.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/component/AddStudySetToFolderTopAppBar.kt index ec63cc84..72f4042f 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/component/AddStudySetToFolderTopAppBar.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/add_study_set/component/AddStudySetToFolderTopAppBar.kt @@ -14,10 +14,12 @@ import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.sp import com.pwhs.quickmem.ui.theme.QuickMemTheme +import com.pwhs.quickmem.R @OptIn(ExperimentalMaterial3Api::class) @Composable @@ -50,7 +52,7 @@ fun AddStudySetToFolderTopAppBar( ) ) { Text( - text = "Done", + text = stringResource(id = R.string.txt_done), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold, color = colorScheme.onSurface, @@ -67,7 +69,7 @@ fun AddStudySetToFolderTopAppBar( ) ) { Text( - text = "Cancel", + text = stringResource(id = R.string.txt_cancel), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold, color = colorScheme.onSurface, diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/create/CreateFolderScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/create/CreateFolderScreen.kt index 7a53f6f7..8d4d66e1 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/create/CreateFolderScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/create/CreateFolderScreen.kt @@ -12,9 +12,11 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.pwhs.quickmem.R import com.pwhs.quickmem.presentation.component.CreateTextField import com.pwhs.quickmem.presentation.component.CreateTopAppBar import com.pwhs.quickmem.presentation.component.LoadingOverlay @@ -92,7 +94,7 @@ fun CreateFolder( CreateTopAppBar( onNavigateBack = onNavigateBack, onDoneClick = onDoneClick, - title = "Create new folder" + title = stringResource(id = R.string.txt_create_folder) ) } ) { innerPadding -> @@ -104,20 +106,20 @@ fun CreateFolder( ) { CreateTextField( value = title, - title = "Folder Title", + title = stringResource(id = R.string.txt_folder_title), valueError = titleError, onValueChange = onTitleChange, - placeholder = "Enter Folder Title" + placeholder = stringResource(id = R.string.txt_enter_folder_title) ) CreateTextField( value = description, - title = "Description (Optional)", + title = stringResource(id = R.string.txt_description_optional), valueError = descriptionError, onValueChange = onDescriptionChange, - placeholder = "Enter Description" + placeholder = stringResource(id = R.string.txt_enter_description) ) SwitchContainer( - text = "When you make a folder public, anyone can see it and use it.", + text = stringResource(R.string.txt_when_you_make_a_folder_public_anyone_can_see_it_and_use_it), checked = isPublic, onCheckedChange = onIsPublicChange ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/edit/EditFolderScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/edit/EditFolderScreen.kt index 1f640284..23ce6e24 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/edit/EditFolderScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/folder/edit/EditFolderScreen.kt @@ -12,9 +12,11 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.pwhs.quickmem.R import com.pwhs.quickmem.presentation.component.CreateTextField import com.pwhs.quickmem.presentation.component.CreateTopAppBar import com.pwhs.quickmem.presentation.component.LoadingOverlay @@ -93,7 +95,7 @@ fun EditFolder( CreateTopAppBar( onNavigateBack = onNavigateBack, onDoneClick = onDoneClick, - title = "Edit folder" + title = stringResource(R.string.txt_edit_folder) ) } ) { innerPadding -> @@ -105,20 +107,20 @@ fun EditFolder( ) { CreateTextField( value = title, - title = "Folder Title", + title = stringResource(R.string.txt_folder_title), valueError = titleError, onValueChange = onTitleChange, - placeholder = "Enter Folder Title" + placeholder = stringResource(R.string.txt_enter_folder_title) ) CreateTextField( value = description, - title = "Description (Optional)", + title = stringResource(R.string.txt_description_optional), valueError = descriptionError, onValueChange = onDescriptionChange, - placeholder = "Enter Description" + placeholder = stringResource(R.string.txt_enter_description ) ) SwitchContainer( - text = "When you make a folder public, anyone can see it and use it.", + text = stringResource(R.string.txt_when_you_make_a_folder_public_anyone_can_see_it_and_use_it), checked = isPublic, onCheckedChange = onIsPublicChange ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/home/HomeScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/home/HomeScreen.kt index d2d74d67..c566d514 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/home/HomeScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/home/HomeScreen.kt @@ -408,7 +408,7 @@ private fun Home( if (studySets.isEmpty() && classes.isEmpty() && folders.isEmpty() && !isLoading) { item { Text( - text = "Here's how to get started", + text = stringResource(R.string.txt_here_is_how_to_get_started), style = typography.titleMedium.copy( color = colorScheme.primary, fontWeight = FontWeight.Bold @@ -434,14 +434,14 @@ private fun Home( ) { Icon( painter = painterResource(R.drawable.ic_three_cards), - contentDescription = "Create a flashcard", + contentDescription = stringResource(R.string.txt_create_a_flashcard), tint = Color.Blue, modifier = Modifier .size(50.dp) ) Text( - text = "Create your own flashcards", + text = stringResource(R.string.txt_create_your_own_flashcards), style = typography.titleMedium.copy( color = colorScheme.onSurface, fontWeight = FontWeight.Bold @@ -460,7 +460,7 @@ private fun Home( if (studySets.isNotEmpty()) { item { Text( - text = "Study sets", + text = stringResource(R.string.txt_study_sets), style = typography.titleMedium.copy( color = colorScheme.primary, fontWeight = FontWeight.Bold @@ -488,7 +488,7 @@ private fun Home( if (folders.isNotEmpty()) { item { Text( - text = "Folders", + text = stringResource(R.string.txt_folders), style = typography.titleMedium.copy( color = colorScheme.primary, fontWeight = FontWeight.Bold @@ -518,7 +518,7 @@ private fun Home( if (classes.isNotEmpty()) { item { Text( - text = "Classes", + text = stringResource(R.string.txt_classes), style = typography.titleMedium.copy( color = colorScheme.primary, fontWeight = FontWeight.Bold @@ -545,7 +545,7 @@ private fun Home( item { Text( - text = "Top 5 subjects have study sets", + text = stringResource(R.string.txt_top_5_subjects_have_study_sets), style = typography.titleMedium.copy( color = colorScheme.primary, fontWeight = FontWeight.Bold @@ -611,8 +611,8 @@ private fun Home( modifier = Modifier.padding(bottom = 16.dp) ) Text( - text = "Practice every day so you don't lose your streak!", - modifier.padding(top = 16.dp) + text = stringResource(R.string.txt_practice_every_day), + modifier = Modifier.padding(top = 16.dp) ) StreakCalendar( currentDate = currentDate, diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/home/components/FolderHomeItem.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/home/components/FolderHomeItem.kt index 3678f804..7e6e7c9c 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/home/components/FolderHomeItem.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/home/components/FolderHomeItem.kt @@ -79,7 +79,7 @@ fun FolderHomeItem( ) { Icon( imageVector = Outlined.Folder, - contentDescription = "Folder Icon", + contentDescription = stringResource(R.string.txt_folder_icon), ) Text( text = title, diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/home/components/StreakCalendar.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/home/components/StreakCalendar.kt index a0e9f37b..ca345308 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/home/components/StreakCalendar.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/home/components/StreakCalendar.kt @@ -10,6 +10,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -62,7 +63,7 @@ fun StreakCalendar( if (hasStreak) { Image( painter = painterResource(id = R.drawable.ic_fire_date), - contentDescription = "Streak Fire", + contentDescription = stringResource(R.string.txt_streak_fire), modifier = Modifier.fillMaxSize() ) } else { diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/home/search_by_subject/SearchStudySetBySubjectScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/home/search_by_subject/SearchStudySetBySubjectScreen.kt index 591034cc..e67b83d1 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/home/search_by_subject/SearchStudySetBySubjectScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/home/search_by_subject/SearchStudySetBySubjectScreen.kt @@ -254,7 +254,7 @@ fun SearchStudySetBySubject( onClick = { retry() }, modifier = Modifier.padding(top = 16.dp) ) { - Text(text = "Retry") + Text(text = stringResource(R.string.txt_retry)) } } } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/profile/ProfileScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/profile/ProfileScreen.kt index b2e8180a..e3d7cd03 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/profile/ProfileScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/profile/ProfileScreen.kt @@ -293,7 +293,7 @@ fun Profile( item { Text( - text = "Look at your streak!", + text = stringResource(R.string.txt_look_at_your_streak), style = typography.bodyLarge.copy( fontWeight = FontWeight.ExtraBold, fontSize = 20.sp @@ -344,7 +344,7 @@ fun Profile( modifier = Modifier.padding(bottom = 16.dp) ) Text( - text = "Practice every day so you don't lose your streak!", + text = stringResource(R.string.txt_practice_every_day_so_you_don_t_lose_your_streak), style = typography.bodyMedium.copy( fontWeight = FontWeight.Bold ), diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/report/ReportScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/report/ReportScreen.kt index 63dfce1e..93cf836c 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/report/ReportScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/report/ReportScreen.kt @@ -32,10 +32,12 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.PreviewLightDark import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import com.pwhs.quickmem.R import com.pwhs.quickmem.ui.theme.QuickMemTheme import com.ramcosta.composedestinations.annotation.Destination import com.ramcosta.composedestinations.annotation.RootGraph @@ -60,7 +62,6 @@ fun ReportScreen( selectedReason = selectedReason, onReasonSelected = { selectedReason = it }, onContinue = { - // TODO: Implement report logic Toast.makeText(context, "Reported!", Toast.LENGTH_SHORT).show() navigator.popBackStack() }, @@ -154,7 +155,7 @@ fun Report( enabled = selectedReason.isNotEmpty() ) { Text( - text = "Continue", + text = stringResource(R.string.txt_continue), style = MaterialTheme.typography.bodyLarge.copy( fontWeight = FontWeight.Bold ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/SearchResultScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/SearchResultScreen.kt index b1575680..19e200c9 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/SearchResultScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/SearchResultScreen.kt @@ -25,12 +25,14 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.paging.compose.LazyPagingItems import androidx.paging.compose.collectAsLazyPagingItems +import com.pwhs.quickmem.R import com.pwhs.quickmem.domain.model.classes.GetClassByOwnerResponseModel import com.pwhs.quickmem.domain.model.color.ColorModel import com.pwhs.quickmem.domain.model.folder.GetFolderResponseModel @@ -227,7 +229,7 @@ fun SearchResult( topBar = { TopBarSearchResult( onNavigateBack = onNavigateBack, - title = "Result \"${query}\"", + title = stringResource(R.string.txt_result, query), onClickFilter = { if (tabIndex == SearchResultEnum.STUDY_SET.index) { showFilterBottomSheet = true diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/all_result/ListAllResultScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/all_result/ListAllResultScreen.kt index b0796a7a..828fc16f 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/all_result/ListAllResultScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/all_result/ListAllResultScreen.kt @@ -14,6 +14,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.paging.compose.LazyPagingItems @@ -62,10 +63,10 @@ fun ListAllResultScreen( ) { Image( painter = painterResource(id = R.drawable.ic_flashcards), - contentDescription = "No results found", + contentDescription = stringResource(R.string.txt_no_results_found), ) Text( - text = "No results found", + text = stringResource(R.string.txt_no_results_found), style = typography.titleLarge, textAlign = TextAlign.Center ) @@ -81,7 +82,7 @@ fun ListAllResultScreen( if (studySets?.itemCount != 0) { item { SectionHeader( - title = "Study Sets", + title = stringResource(R.string.txt_study_sets), onSeeAllClick = onSeeAllClickStudySet ) } @@ -97,7 +98,7 @@ fun ListAllResultScreen( if (folders?.itemCount != 0) { item { SectionHeader( - title = "Folders", + title = stringResource(R.string.txt_folders), onSeeAllClick = onSeeAllClickFolder ) } @@ -116,7 +117,7 @@ fun ListAllResultScreen( if (classes?.itemCount != 0) { item { SectionHeader( - title = "Classes", + title = stringResource(R.string.txt_classes), onSeeAllClick = onSeeAllClickClass ) } @@ -132,7 +133,7 @@ fun ListAllResultScreen( if (users?.itemCount != 0) { item { SectionHeader( - title = "Users", + title = stringResource(R.string.txt_users), onSeeAllClick = onSeeAllClickUsers ) } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/all_result/component/SectionHeader.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/all_result/component/SectionHeader.kt index d58b0df7..cff5e447 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/all_result/component/SectionHeader.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/all_result/component/SectionHeader.kt @@ -10,8 +10,10 @@ import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp +import com.pwhs.quickmem.R @Composable fun SectionHeader( @@ -34,7 +36,7 @@ fun SectionHeader( onClick = onSeeAllClick ) { Text( - text = "View all", + text = stringResource(R.string.txt_view_all), style = typography.titleMedium, textAlign = TextAlign.Center ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/classes/ListResultClassesScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/classes/ListResultClassesScreen.kt index 2caa125a..14f133bf 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/classes/ListResultClassesScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/classes/ListResultClassesScreen.kt @@ -117,7 +117,7 @@ fun ListResultClassesScreen( onClick = onClassRefresh, modifier = Modifier.padding(top = 16.dp) ) { - Text(text = "Retry") + Text(text = stringResource(R.string.txt_retry)) } } } @@ -163,7 +163,7 @@ fun ListResultClassesScreen( onClick = { retry() }, modifier = Modifier.padding(top = 16.dp) ) { - Text(text = "Retry") + Text(text = stringResource(R.string.txt_retry)) } } } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/component/TopBarSearch.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/component/TopBarSearch.kt index 4c78f6b7..fb986126 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/component/TopBarSearch.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/component/TopBarSearch.kt @@ -18,6 +18,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.PreviewLightDark @@ -61,7 +62,7 @@ fun TopBarSearchResult( ) { Icon( painter = painterResource(id = R.drawable.ic_filter), - contentDescription = "Filter", + contentDescription = stringResource(R.string.txt_filter), ) } } @@ -75,7 +76,7 @@ fun TopBarSearchResult( ) { Icon( imageVector = AutoMirrored.Filled.ArrowBack, - contentDescription = "Back", + contentDescription = stringResource(R.string.txt_back), ) } } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/component/TopBarSearchResult.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/component/TopBarSearchResult.kt index a2b26779..1ddd8ba5 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/component/TopBarSearchResult.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/component/TopBarSearchResult.kt @@ -11,9 +11,11 @@ import androidx.compose.material3.TopAppBarDefaults.topAppBarColors import androidx.compose.runtime.* import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.PreviewLightDark import androidx.compose.ui.unit.sp +import com.pwhs.quickmem.R import com.pwhs.quickmem.ui.theme.QuickMemTheme @OptIn(ExperimentalMaterial3Api::class) @@ -47,7 +49,7 @@ fun TopBarSearch( ) ) { Text( - text = "Reset", + text = stringResource(R.string.txt_reset), style = typography.titleMedium.copy( fontWeight = FontWeight.Bold, color = colorScheme.onSurface, @@ -65,7 +67,7 @@ fun TopBarSearch( ) { Icon( imageVector = AutoMirrored.Filled.ArrowBack, - contentDescription = "Back", + contentDescription = stringResource(R.string.txt_back), ) } } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/folder/ListResultFolderScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/folder/ListResultFolderScreen.kt index 6908a7ef..73e7e245 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/folder/ListResultFolderScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/folder/ListResultFolderScreen.kt @@ -13,7 +13,6 @@ import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Error import androidx.compose.material3.Button import androidx.compose.material3.CircularProgressIndicator -import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.MaterialTheme.colorScheme import androidx.compose.material3.MaterialTheme.typography import androidx.compose.material3.Scaffold @@ -121,7 +120,7 @@ fun ListResultFolderScreen( onClick = onFolderRefresh, modifier = Modifier.padding(top = 16.dp) ) { - Text(text = "Retry") + Text(text = stringResource(R.string.txt_retry)) } } } @@ -167,7 +166,7 @@ fun ListResultFolderScreen( onClick = { retry() }, modifier = Modifier.padding(top = 16.dp) ) { - Text(text = "Retry") + Text(text = stringResource(R.string.txt_retry)) } } } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/study_set/ListResultStudySetScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/study_set/ListResultStudySetScreen.kt index 0dc63a93..2d735842 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/study_set/ListResultStudySetScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/study_set/ListResultStudySetScreen.kt @@ -118,7 +118,7 @@ fun ListResultStudySetScreen( onClick = onStudySetRefresh, modifier = Modifier.padding(top = 16.dp) ) { - Text(text = "Retry") + Text(text = stringResource(R.string.txt_retry)) } } } @@ -164,7 +164,7 @@ fun ListResultStudySetScreen( onClick = { retry() }, modifier = Modifier.padding(top = 16.dp) ) { - Text(text = "Retry") + Text(text = stringResource(R.string.txt_retry)) } } } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/study_set/component/FilterStudySetBottomSheet.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/study_set/component/FilterStudySetBottomSheet.kt index 247752cb..81fd4f21 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/study_set/component/FilterStudySetBottomSheet.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/study_set/component/FilterStudySetBottomSheet.kt @@ -8,9 +8,11 @@ import androidx.compose.runtime.* import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import com.pwhs.quickmem.R import com.pwhs.quickmem.domain.model.color.ColorModel import com.pwhs.quickmem.domain.model.subject.SubjectModel import com.pwhs.quickmem.presentation.app.search_result.component.TopBarSearch @@ -55,7 +57,7 @@ fun FilterStudySetBottomSheet( ) { item { TopBarSearch( - title = "Filters", + title = stringResource(R.string.txt_filters), onNavigateBack = onNavigateBack, onResetClick = onResetClick ) @@ -65,7 +67,7 @@ fun FilterStudySetBottomSheet( item { FilterSection( - title = "Number of terms", + title = stringResource(R.string.txt_number_of_terms), options = SearchResultSizeEnum.entries.map { it.title }, selectedOption = sizeModel.title, onOptionSelected = { selectedContent -> @@ -78,7 +80,7 @@ fun FilterStudySetBottomSheet( item { FilterSection( - title = "Created by", + title = stringResource(R.string.txt_created_by), options = SearchResultCreatorEnum.entries.map { it.title }, selectedOption = creatorTypeModel.title, onOptionSelected = { @@ -98,7 +100,7 @@ fun FilterStudySetBottomSheet( horizontalArrangement = Arrangement.SpaceBetween ) { Text( - text = "AI Generated", + text = stringResource(R.string.txt_ai_generated), fontSize = 16.sp, fontWeight = FontWeight.Bold ) @@ -135,7 +137,7 @@ fun FilterStudySetBottomSheet( .height(50.dp), ) { Text( - text = "Apply", + text = stringResource(R.string.txt_apply), color = Color.White, fontSize = 16.sp, fontWeight = FontWeight.Bold diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/user/ListResultUserScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/user/ListResultUserScreen.kt index 00eff119..24308b02 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/user/ListResultUserScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/user/ListResultUserScreen.kt @@ -76,7 +76,7 @@ fun ListResultUserScreen( contentDescription = stringResource(R.string.txt_empty_folder), ) Text( - text = "No members", + text = stringResource(R.string.txt_no_members), style = typography.titleLarge, textAlign = TextAlign.Center ) @@ -127,7 +127,7 @@ fun ListResultUserScreen( onClick = onUserRefresh, modifier = Modifier.padding(top = 16.dp) ) { - Text(text = "Retry") + Text(text = stringResource(R.string.txt_retry)) } } } @@ -173,7 +173,7 @@ fun ListResultUserScreen( onClick = { retry() }, modifier = Modifier.padding(top = 16.dp) ) { - Text(text = "Retry") + Text(text = stringResource(R.string.txt_retry)) } } } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/user/component/SearchUserResultItem.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/user/component/SearchUserResultItem.kt index 1c1cd4c9..2ce1cf49 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/user/component/SearchUserResultItem.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/search_result/user/component/SearchUserResultItem.kt @@ -21,11 +21,13 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import coil.compose.AsyncImage +import com.pwhs.quickmem.R import com.pwhs.quickmem.domain.model.users.SearchUserResponseModel import com.pwhs.quickmem.ui.theme.QuickMemTheme @@ -66,7 +68,7 @@ fun SearchUserResultItem( ) { AsyncImage( model = searchMemberModel?.avatarUrl, - contentDescription = "avatar", + contentDescription = stringResource(R.string.txt_avatar), contentScale = ContentScale.Crop, modifier = Modifier .size(30.dp) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/SettingsScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/SettingsScreen.kt index cdf2a4cb..95056a94 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/SettingsScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/SettingsScreen.kt @@ -439,7 +439,7 @@ fun Setting( ) HorizontalDivider() SettingItem( - title = "Email", + title = stringResource(R.string.txt_email), subtitle = email, onClick = { showVerifyPasswordBottomSheet = true diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/component/SettingValidatePasswordBottomSheet.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/component/SettingValidatePasswordBottomSheet.kt index 347e832e..7f24223a 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/component/SettingValidatePasswordBottomSheet.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/component/SettingValidatePasswordBottomSheet.kt @@ -16,9 +16,11 @@ import androidx.compose.material3.Text import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.pwhs.quickmem.R import com.pwhs.quickmem.ui.theme.QuickMemTheme @OptIn(ExperimentalMaterial3Api::class) @@ -43,13 +45,13 @@ fun SettingValidatePasswordBottomSheet( modifier = Modifier.padding(16.dp) ) { Text( - "First, verify your account", + stringResource(R.string.txt_first_verify_your_account), style = typography.titleLarge.copy( fontWeight = FontWeight.Bold ) ) Text( - "To confirm it's really you, please enter your QuickMem password", + stringResource(R.string.txt_to_confirm_it_s_really_you_please_enter_your_quickmem_password), style = typography.bodyMedium, modifier = Modifier.padding(top = 8.dp) ) @@ -58,7 +60,7 @@ fun SettingValidatePasswordBottomSheet( value = password, onValueChange = onChangePassword, errorMessage = errorMessage, - placeholder = "Password", + placeholder = stringResource(R.string.txt_password), isSecure = true ) Button( @@ -69,7 +71,8 @@ fun SettingValidatePasswordBottomSheet( shape = shapes.medium ) { Text( - "Submit", style = typography.bodyMedium.copy( + stringResource(R.string.txt_submit), + style = typography.bodyMedium.copy( fontWeight = FontWeight.Bold ) ) @@ -85,7 +88,7 @@ fun SettingValidatePasswordBottomSheet( shape = shapes.medium ) { Text( - "Cancel", + stringResource(R.string.txt_cancel), style = typography.bodyMedium.copy( fontWeight = FontWeight.Bold ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/change_password/ChangePasswordSettingScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/change_password/ChangePasswordSettingScreen.kt index ca59f542..53510214 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/change_password/ChangePasswordSettingScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/change_password/ChangePasswordSettingScreen.kt @@ -9,9 +9,11 @@ import androidx.compose.material3.Scaffold import androidx.compose.runtime.* import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.pwhs.quickmem.R import com.pwhs.quickmem.presentation.app.settings.component.SettingTextField import com.pwhs.quickmem.presentation.app.settings.component.SettingTopAppBar import com.pwhs.quickmem.presentation.component.LoadingOverlay @@ -93,7 +95,7 @@ fun ChangePasswordSetting( modifier = modifier, topBar = { SettingTopAppBar( - title = "Change Password", + title = stringResource(R.string.txt_change_password), onNavigateBack = onNavigateBack, onSaved = onSaved, enabled = currentPassword.isNotEmpty() && newPassword.isNotEmpty() && confirmPassword.isNotEmpty() @@ -112,7 +114,7 @@ fun ChangePasswordSetting( .padding(horizontal = 16.dp), value = currentPassword, onValueChange = onCurrentPasswordChanged, - placeholder = "Current Password", + placeholder = stringResource(R.string.txt_current_password), errorMessage = errorCurrentPassword, isSecure = true ) @@ -121,7 +123,7 @@ fun ChangePasswordSetting( .padding(horizontal = 16.dp), value = newPassword, onValueChange = onNewPasswordChanged, - placeholder = "New Password", + placeholder = stringResource(R.string.txt_new_password), errorMessage = errorNewPassword, isSecure = true ) @@ -130,7 +132,7 @@ fun ChangePasswordSetting( .padding(horizontal = 16.dp), value = confirmPassword, onValueChange = onConfirmPasswordChanged, - placeholder = "Confirm New Password", + placeholder = stringResource(R.string.txt_confirm_new_password), errorMessage = errorConfirmPassword, isSecure = true ) diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/email/UpdateEmailScreenSetting.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/email/UpdateEmailScreenSetting.kt index 147d0b13..af2d97ff 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/email/UpdateEmailScreenSetting.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/email/UpdateEmailScreenSetting.kt @@ -9,9 +9,11 @@ import androidx.compose.material3.Scaffold import androidx.compose.runtime.* import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.pwhs.quickmem.R import com.pwhs.quickmem.presentation.app.settings.component.SettingTextField import com.pwhs.quickmem.presentation.app.settings.component.SettingTopAppBar import com.pwhs.quickmem.presentation.component.LoadingOverlay @@ -77,7 +79,7 @@ fun UpdateEmailSetting( modifier = modifier, topBar = { SettingTopAppBar( - title = "Email", + title = stringResource(R.string.txt_email), onNavigateBack = onNavigateBack, onSaved = onSaved, enabled = email.isNotEmpty() @@ -96,7 +98,7 @@ fun UpdateEmailSetting( .padding(horizontal = 16.dp), value = email, onValueChange = onEmailChanged, - placeholder = "Email", + placeholder = stringResource(R.string.txt_email), errorMessage = errorMessage ) } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/full_name/UpdateFullNameSettingScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/full_name/UpdateFullNameSettingScreen.kt index 2f22f99c..9add27da 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/full_name/UpdateFullNameSettingScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/full_name/UpdateFullNameSettingScreen.kt @@ -12,9 +12,11 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.pwhs.quickmem.R import com.pwhs.quickmem.presentation.app.settings.component.SettingTextField import com.pwhs.quickmem.presentation.app.settings.component.SettingTopAppBar import com.pwhs.quickmem.presentation.component.LoadingOverlay @@ -78,7 +80,7 @@ fun UpdateFullNameSetting( modifier = modifier, topBar = { SettingTopAppBar( - title = "Full Name", + title = stringResource(R.string.txt_full_name), onNavigateBack = onNavigateBack, onSaved = onSaved, enabled = fullName.isNotEmpty() @@ -97,7 +99,7 @@ fun UpdateFullNameSetting( .padding(horizontal = 16.dp), value = fullName, onValueChange = onFullNameChanged, - placeholder = "Full Name", + placeholder = stringResource(R.string.txt_full_name), errorMessage = errorMessage ) } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/username/UpdateUsernameSettingScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/username/UpdateUsernameSettingScreen.kt index c8c1a29e..8cec3e37 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/username/UpdateUsernameSettingScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/settings/user_info/username/UpdateUsernameSettingScreen.kt @@ -13,9 +13,11 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel +import com.pwhs.quickmem.R import com.pwhs.quickmem.presentation.app.settings.component.SettingTextField import com.pwhs.quickmem.presentation.app.settings.component.SettingTopAppBar import com.pwhs.quickmem.presentation.component.LoadingOverlay @@ -79,7 +81,7 @@ fun UpdateUsernameSetting( modifier = modifier, topBar = { SettingTopAppBar( - title = "Username", + title = stringResource(R.string.txt_username), onNavigateBack = onNavigateBack, onSaved = onSaved, enabled = username.isNotEmpty() @@ -98,7 +100,7 @@ fun UpdateUsernameSetting( .padding(horizontal = 16.dp), value = username, onValueChange = onUsernameChanged, - placeholder = "Username", + placeholder = stringResource(R.string.txt_username), errorMessage = errorMessage ) } diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/app/user_detail/UserDetailScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/app/user_detail/UserDetailScreen.kt index 7e8a2062..592ec3e2 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/app/user_detail/UserDetailScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/app/user_detail/UserDetailScreen.kt @@ -265,7 +265,7 @@ private fun UserDetail( ) if (role == "TEACHER") { Text( - text = "Teacher", + text = stringResource(R.string.txt_teacher), style = typography.bodySmall.copy( fontWeight = FontWeight.Bold ), diff --git a/app/src/main/java/com/pwhs/quickmem/presentation/auth/login/LoginScreen.kt b/app/src/main/java/com/pwhs/quickmem/presentation/auth/login/LoginScreen.kt index 5208c6ea..c7d3386d 100644 --- a/app/src/main/java/com/pwhs/quickmem/presentation/auth/login/LoginScreen.kt +++ b/app/src/main/java/com/pwhs/quickmem/presentation/auth/login/LoginScreen.kt @@ -136,7 +136,7 @@ fun Login( ) { Text( - text = stringResource(R.string.tx_log_in), + text = stringResource(R.string.txt_log_in), style = typography.headlineMedium.copy( fontWeight = FontWeight.Bold, color = colorScheme.primary @@ -185,7 +185,7 @@ fun Login( AuthButton( modifier = Modifier.padding(top = 16.dp), onClick = onLoginWithGoogle, - text = stringResource(R.string.tx_continue_with_google), + text = stringResource(R.string.txt_continue_with_google), colors = Color.White, textColor = colorScheme.onSurface, icon = R.drawable.ic_google, diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 66c4643e..df88d33a 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -18,10 +18,8 @@ Vui lòng nhập mật khẩu mới của bạn Mật khẩu mới Xác nhận mật khẩu - Đăng nhập Đăng nhập bằng email hoặc - Tiếp tục với Google Tiếp tục với Facebook Chưa có tài khoản? Đăng ký @@ -258,4 +256,104 @@ Chào mừng trở lại! Đăng nhập vào tài khoản của bạn Được tạo bởi AI Đúng + Chuỗi thành tích cao nhất + Tạo bộ học AI + Huy chương vàng + Huy chương bạc + Huy chương đồng + Bảng xếp hạng 10 chuỗi thành tích cao nhất + Duy trì chuỗi để leo bảng xếp hạng! + Tạo + Cảnh báo: AI có thể không tạo thẻ học chính xác hoặc đầy đủ. Vui lòng kiểm tra nếu nghi ngờ. + Tiêu đề (bắt buộc) + Mô tả (tùy chọn) + Số lượng thẻ học (tùy chọn) + Loại câu hỏi + Trắc nghiệm + Mức độ khó + Dễ + Trung bình + Khó + Cờ VN + Kiểm tra + Cờ Mỹ + Dưới đây là cách bắt đầu + Tạo một thẻ học + Tạo thẻ học của riêng bạn + Top 5 môn học có bộ học + Luyện tập mỗi ngày để không mất chuỗi! + Thử lại + Biểu tượng thư mục + Chuỗi lửa + Xem tất cả + Không tìm thấy kết quả + Người dùng + Lọc + Bộ lọc + Số lượng thuật ngữ + Áp dụng + Ảnh đại diện + Kết quả \"%1$s\" + Thêm thư mục + Tạo thư mục + Biểu tượng kiểm tra + Biểu tượng thêm + Chưa có thư mục nào, hãy tạo một cái để bắt đầu! + Chưa có bộ học nào thuộc sở hữu, hãy tạo một cái để bắt đầu! + Không tìm thấy bộ học + Tạo bộ học + Tạo lớp học mới + Tiêu đề lớp + Nhập tiêu đề lớp + Nhập mô tả lớp + Cho phép thành viên lớp gửi lời mời đến người khác + Cho phép thành viên lớp thêm bộ học và thư mục + Thêm bộ học vào lớp + Thêm thư mục vào lớp + Chỉnh sửa lớp + Tham gia lớp + Chia sẻ lớp + Rời lớp + Xóa lớp + Báo cáo lớp + Chủ sở hữu + Lớp này chưa có thành viên + Thêm thành viên để chia sẻ với lớp của bạn. + Thêm thành viên + Thêm bộ học mới vào lớp + Lớp này chưa có bộ học nào + Thêm các bộ flashcard để chia sẻ với lớp của bạn. + Thêm bộ học + Thành viên + Chỉnh sửa lớp này + Tiêu đề thư mục + Nhập tiêu đề thư mục + Nhập mô tả + Chi tiết lớp + Tiêu đề + Hình ảnh lớp + Hình ảnh cho định nghĩa + Thêm hình ảnh vào định nghĩa + Hình ảnh đầy đủ + Xóa hình ảnh + Lưu + Vẽ + Hủy và quay lại + Độ rộng nét vẽ + Khi bạn công khai một thư mục, bất kỳ ai cũng có thể xem và sử dụng nó. + Xem chuỗi của bạn! + Luyện tập mỗi ngày để không mất chuỗi của bạn! + Tiếp tục + Đầu tiên, xác minh tài khoản của bạn + Để xác nhận bạn thực sự là bạn, vui lòng nhập mật khẩu QuickMem của bạn + Mật khẩu hiện tại + Xác nhận mật khẩu mới + Bạn đã đạt vị trí số %1$d trên bảng xếp hạng chuỗi đỉnh cao! + Bạn có chắc chắn muốn xóa lớp này không? + Bạn có chắc chắn muốn rời khỏi lớp này không? + Thoát + Mời thành viên + Mời các thành viên + Để mời thành viên vào lớp này, hãy thêm tên người dùng QuickMem của họ bên dưới. + Nhập tên người dùng để mời \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5b627a73..613abc27 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -19,10 +19,9 @@ Please enter your new password New Password Confirm Password - Log in Log in with email or - Continue with Google + Continue with Google Continue with Facebook Don\'t have an account? " Sign up" @@ -45,7 +44,6 @@ Signing up… Login Sign up with email - Continue with Google By signing up, you agree to the " Terms and Conditions" " and the " @@ -261,4 +259,104 @@ Welcome back! Log in to your account AI Generated Yes + Top Streak + Create Study Set AI + Gold Medal + Silver Medal + Bronze Medal + Top 10 highest streak leaderboard + Keep up the streak to climb the leaderboard! + Create + Warning: AI may not generate accurate or complete flashcards. Please review if unsure. + Title (required) + Description (optional) + Number of flashcards (optional) + Question type + Multiple choice + Difficulty level + Easy + Medium + Hard + VN Flag + Check + US Flag + Here\'s how to get started + Create a flashcard + Create your own flashcards + Top 5 subjects with study sets + Practice every day so you don\'t lose your streak! + Retry + Folder Icon + Streak Fire + View all + No results found + Users + Filter + Filters + Number of terms + Apply + avatar + Result \"%1$s\" + Add Folder + Create Folder + Check Icon + Add Icon + There are no folders yet, create one to get started! + There are no owned study sets, create one to get started! + No study set fold found + Create Study Set + Create new class + Class Title + Enter Class Title + Enter Class Description + Allow class members to send invites to others + Allow class members to add study sets and folders + Add study set to class + Add folder to class + Edit Class + Join Class + Share Class + Exit Class + Delete Class + Report Class + Owner + This class has no members + Add members to share them with your class. + Add Members + Add new study set to class + This class has no sets + Add flashcard sets to share them with your class. + Add study sets + Members + Edit this class + Folder Title + Enter Folder Title + Enter Description + Class Detail + Title + Class Image + Image for definition + Add Image to Definition + Full Image + Delete Image + Save + Draw + Cancel and back + Stroke Width + When you make a folder public, anyone can see it and use it. + Look at your streak! + Practice every day so you don\'t lose your streak! + Continue + First, verify your account + To confirm it\'s really you, please enter your QuickMem password + Current Password + Confirm New Password + You have reached the top #%1$s on the Top Streak leaderboard! + Are you sure you want to delete this class? + Are you sure you want to exit this class? + Exit + Invite Member + Invite Members + To invite members to this class, add their QuickMem usernames below. + Type username to invite \ No newline at end of file