diff --git a/Frontend-Learner/i18n/locales/en.json b/Frontend-Learner/i18n/locales/en.json index f232f403..f3ef2399 100644 --- a/Frontend-Learner/i18n/locales/en.json +++ b/Frontend-Learner/i18n/locales/en.json @@ -36,12 +36,13 @@ "certificate": "Certificate", "available": "Available", "continueLearning": "Continue Learning", + "startLearning": "Start Learning", "studyAgain": "Study Again", "downloadCertificate": "Download Certificate", "completed": "Completed" }, "sidebar": { - "overview": "Overview", + "overview": "Home", "myCourses": "My Courses", "browseCourses": "Browse Courses", "announcements": "Announcements", @@ -117,7 +118,10 @@ "verifyEmailSuccess": "Verification email sent successfully", "verifyEmailError": "Failed to send verification email", "emailAlreadyVerified": "Your email is already verified", - "emailVerified": "Email Verified" + "emailVerified": "Email Verified", + "myCertificates": "My Certificates", + "viewCertificate": "View Certificate", + "issuedAt": "Issued at" }, "userMenu": { "home": "Home", @@ -139,7 +143,8 @@ "emailVerified": "Email Verified Successfully!", "emailVerifiedDesc": "Your account has been successfully verified.", "invalidToken": "Invalid verification token", - "tokenExpired": "Token expired or invalid" + "tokenExpired": "Token expired or invalid", + "logout": "Log Out" }, "language": { "label": "Language / ภาษา", @@ -150,6 +155,7 @@ "newBadge": "New", "popularBadge": "Popular", "save": "Save", + "close": "Close", "cancel": "Cancel", "required": "This field is required", "invalidEmail": "Invalid email address", diff --git a/Frontend-Learner/i18n/locales/th.json b/Frontend-Learner/i18n/locales/th.json index 7297e61a..8561e0fb 100644 --- a/Frontend-Learner/i18n/locales/th.json +++ b/Frontend-Learner/i18n/locales/th.json @@ -118,7 +118,10 @@ "verifyEmailSuccess": "ส่งอีเมลยืนยันสำเร็จ", "verifyEmailError": "ส่งอีเมลไม่สำเร็จ", "emailAlreadyVerified": "อีเมลของคุณได้รับการยืนยันแล้ว", - "emailVerified": "ยืนยันอีเมลเสร็จสิ้น" + "emailVerified": "ยืนยันอีเมลเสร็จสิ้น", + "myCertificates": "ประกาศนียบัตรของฉัน", + "viewCertificate": "ดูประกาศนียบัตร", + "issuedAt": "ออกเมื่อ" }, "userMenu": { "home": "หน้าหลัก", diff --git a/Frontend-Learner/pages/dashboard/profile.vue b/Frontend-Learner/pages/dashboard/profile.vue index d92732f0..bfa7b4ec 100644 --- a/Frontend-Learner/pages/dashboard/profile.vue +++ b/Frontend-Learner/pages/dashboard/profile.vue @@ -10,7 +10,7 @@ useHead({ const { currentUser, updateUserProfile, changePassword, uploadAvatar, sendVerifyEmail, fetchUserProfile } = useAuth() const { fetchAllCertificates, getLocalizedText } = useCourse() -const { t } = useI18n() +const { locale, t } = useI18n() @@ -28,7 +28,7 @@ const formatDate = (dateString?: string) => { if (!dateString) return '-' try { const date = new Date(dateString) - return new Intl.DateTimeFormat('th-TH', { + return new Intl.DateTimeFormat(locale.value === 'th' ? 'th-TH' : 'en-US', { day: 'numeric', month: 'short', year: 'numeric' @@ -43,7 +43,7 @@ const userData = ref({ lastName: currentUser.value?.lastName || '', email: currentUser.value?.email || '', phone: currentUser.value?.phone || '', - createdAt: formatDate(currentUser.value?.createdAt), + createdAt: currentUser.value?.createdAt || '', photoURL: currentUser.value?.photoURL || '', prefix: currentUser.value?.prefix?.th || '', emailVerifiedAt: currentUser.value?.emailVerifiedAt @@ -190,6 +190,7 @@ watch(() => currentUser.value, (newUser) => { userData.value.prefix = newUser.prefix?.th || '' userData.value.email = newUser.email userData.value.phone = newUser.phone || '' + userData.value.createdAt = newUser.createdAt || '' userData.value.emailVerifiedAt = newUser.emailVerifiedAt } }, { deep: true }) @@ -285,7 +286,7 @@ onMounted(async () => {
{{ userData.createdAt }}
+{{ formatDate(userData.createdAt) }}
ออกเมื่อ: {{ formatDate(cert.issued_at) }}
+{{ $t('profile.issuedAt') }}: {{ formatDate(cert.issued_at) }}