Skip to content

Commit

Permalink
feat(language): đa ngôn ngữ tại một số chỗ còn lại
Browse files Browse the repository at this point in the history
  • Loading branch information
VawnDao committed Nov 28, 2024
1 parent 1d57a33 commit b3c4549
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
},
Expand Down Expand Up @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ fun Setting(
)
HorizontalDivider()
SettingItem(
title = "Email",
title = stringResource(R.string.txt_email),
subtitle = email,
onClick = {
showVerifyPasswordBottomSheet = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
)
Expand All @@ -58,7 +60,7 @@ fun SettingValidatePasswordBottomSheet(
value = password,
onValueChange = onChangePassword,
errorMessage = errorMessage,
placeholder = "Password",
placeholder = stringResource(R.string.txt_password),
isSecure = true
)
Button(
Expand All @@ -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
)
)
Expand All @@ -85,7 +88,7 @@ fun SettingValidatePasswordBottomSheet(
shape = shapes.medium
) {
Text(
"Cancel",
stringResource(R.string.txt_cancel),
style = typography.bodyMedium.copy(
fontWeight = FontWeight.Bold
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -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
)
Expand All @@ -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
)
Expand All @@ -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
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -96,7 +98,7 @@ fun UpdateEmailSetting(
.padding(horizontal = 16.dp),
value = email,
onValueChange = onEmailChanged,
placeholder = "Email",
placeholder = stringResource(R.string.txt_email),
errorMessage = errorMessage
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -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
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand All @@ -98,7 +100,7 @@ fun UpdateUsernameSetting(
.padding(horizontal = 16.dp),
value = username,
onValueChange = onUsernameChanged,
placeholder = "Username",
placeholder = stringResource(R.string.txt_username),
errorMessage = errorMessage
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ private fun UserDetail(
)
if (role == "TEACHER") {
Text(
text = "Teacher",
text = stringResource(R.string.txt_teacher),
style = typography.bodySmall.copy(
fontWeight = FontWeight.Bold
),
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/res/values-vi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,11 @@
<string name="txt_cancel_and_back">Hủy và quay lại</string>
<string name="txt_stroke_width">Độ rộng nét vẽ</string>
<string name="txt_when_you_make_a_folder_public_anyone_can_see_it_and_use_it">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ó.</string>
<string name="txt_look_at_your_streak">Xem chuỗi của bạn!</string>
<string name="txt_practice_every_day_so_you_don_t_lose_your_streak">Luyện tập mỗi ngày để không mất chuỗi của bạn!</string>
<string name="txt_continue">Tiếp tục</string>
<string name="txt_first_verify_your_account">Đầu tiên, xác minh tài khoản của bạn</string>
<string name="txt_to_confirm_it_s_really_you_please_enter_your_quickmem_password">Để 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</string>
<string name="txt_current_password">Mật khẩu hiện tại</string>
<string name="txt_confirm_new_password">Xác nhận mật khẩu mới</string>
</resources>
7 changes: 7 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,11 @@
<string name="txt_cancel_and_back">Cancel and back</string>
<string name="txt_stroke_width">Stroke Width</string>
<string name="txt_when_you_make_a_folder_public_anyone_can_see_it_and_use_it">When you make a folder public, anyone can see it and use it.</string>
<string name="txt_look_at_your_streak">Look at your streak!</string>
<string name="txt_practice_every_day_so_you_don_t_lose_your_streak">Practice every day so you don\'t lose your streak!</string>
<string name="txt_continue">Continue</string>
<string name="txt_first_verify_your_account">First, verify your account</string>
<string name="txt_to_confirm_it_s_really_you_please_enter_your_quickmem_password">To confirm it\'s really you, please enter your QuickMem password</string>
<string name="txt_current_password">Current Password</string>
<string name="txt_confirm_new_password">Confirm New Password</string>
</resources>

0 comments on commit b3c4549

Please sign in to comment.