From 853c141910d5993aa86d485388ccd182046be66d Mon Sep 17 00:00:00 2001 From: supalerk-ar66 Date: Fri, 6 Mar 2026 13:33:58 +0700 Subject: [PATCH] feat: Add i18n support with English and Thai locales and introduce new browse pages. --- Frontend-Learner/i18n/locales/en.json | 6 +++++- Frontend-Learner/i18n/locales/th.json | 6 +++++- Frontend-Learner/pages/browse/discovery.vue | 6 +++--- Frontend-Learner/pages/browse/index.vue | 23 +++++++++++---------- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Frontend-Learner/i18n/locales/en.json b/Frontend-Learner/i18n/locales/en.json index b854b7c6..15c01013 100644 --- a/Frontend-Learner/i18n/locales/en.json +++ b/Frontend-Learner/i18n/locales/en.json @@ -117,7 +117,11 @@ "foundTotal": "Found Total", "items": "items", "subtitle": "Choose to learn new skills from our curated quality courses", - "searchBtn": "Search" + "searchBtn": "Search", + "allCategory": "All", + "byInstructor": "by", + "students": "students", + "viewDetails": "View Details" }, "myCourses": { "title": "My Courses", diff --git a/Frontend-Learner/i18n/locales/th.json b/Frontend-Learner/i18n/locales/th.json index d096b4ad..fd62257e 100644 --- a/Frontend-Learner/i18n/locales/th.json +++ b/Frontend-Learner/i18n/locales/th.json @@ -117,7 +117,11 @@ "foundTotal": "พบทั้งหมด", "items": "รายการ", "subtitle": "เลือกเรียนรู้ทักษะใหม่ๆ จากหลักสูตรคุณภาพที่คัดสรรมาเพื่อคุณ", - "searchBtn": "ค้นหา" + "searchBtn": "ค้นหา", + "allCategory": "ทั้งหมด", + "byInstructor": "โดย", + "students": "นักเรียน", + "viewDetails": "ดูรายละเอียด" }, "myCourses": { "title": "คอร์สของฉัน", diff --git a/Frontend-Learner/pages/browse/discovery.vue b/Frontend-Learner/pages/browse/discovery.vue index e44bb5ae..ee8c8035 100644 --- a/Frontend-Learner/pages/browse/discovery.vue +++ b/Frontend-Learner/pages/browse/discovery.vue @@ -184,7 +184,7 @@ onMounted(async () => {
-

คอร์สเรียนทั้งหมด

+

{{ $t('discovery.title') }}

@@ -205,7 +205,7 @@ onMounted(async () => { @click="activeCategory = 'all'" :class="activeCategory === 'all' ? 'bg-[#E9EFFD] dark:bg-blue-900/40 text-[#3B6BE8] border-transparent font-bold' : 'bg-white dark:bg-transparent border-slate-200 dark:border-slate-700 text-slate-800 dark:text-slate-300 hover:border-slate-300 font-medium'" class="px-5 py-2.5 rounded-full border text-[13px] sm:text-[14px] flex items-center justify-center gap-2 transition-all outline-none"> - ทั้งหมด + {{ $t('discovery.allCategory') }}
diff --git a/Frontend-Learner/pages/browse/index.vue b/Frontend-Learner/pages/browse/index.vue index c0e3f3c4..41500cb4 100644 --- a/Frontend-Learner/pages/browse/index.vue +++ b/Frontend-Learner/pages/browse/index.vue @@ -13,6 +13,7 @@ useHead({ title: 'คอร์สทั้งหมด - E-Learning System' }) +const { t } = useI18n() const searchQuery = ref('') const { fetchCourses } = useCourse() const { fetchCategories, categories } = useCategory() @@ -131,11 +132,11 @@ const viewMode = ref<'grid' | 'list'>('grid')
-

คอร์สเรียนทั้งหมด

+

{{ $t('discovery.title') }}

- +
@@ -151,7 +152,7 @@ const viewMode = ref<'grid' | 'list'>('grid') @click="selectCategory('all')" :class="selectedCategory === 'all' ? 'bg-[#E9EFFD] dark:bg-blue-900/40 text-[#3B6BE8] border-transparent font-bold' : 'bg-white dark:bg-transparent border-slate-200 dark:border-slate-700 text-slate-800 dark:text-slate-300 hover:border-slate-300 font-medium'" class="px-5 py-2.5 rounded-full border text-[13px] sm:text-[14px] flex items-center justify-center gap-2 transition-all outline-none"> - ทั้งหมด + {{ $t('discovery.allCategory') }}
@@ -246,10 +247,10 @@ const viewMode = ref<'grid' | 'list'>('grid')
-

{{ searchQuery ? 'ไม่พบคอร์สที่คุณค้นหา' : 'ไม่มีคอร์สในหมวดหมู่นี้' }}

-

ลองใช้คำค้นหาอื่น หรือเลือกหมวดหมู่อื่นเพื่อดูคอร์สที่เรามีให้บริการ

+

{{ $t('discovery.emptyTitle') }}

+

{{ $t('discovery.emptyDesc') }}