Skip to content

Commit 675cd24

Browse files
committed
change to Thai language
1 parent bc37c7e commit 675cd24

File tree

13 files changed

+267
-264
lines changed

13 files changed

+267
-264
lines changed

src/app/ai-suggest-tool/page.tsx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const AiSuggestToolPage = () => {
4444
} else {
4545
setError('Unsupported file type. Please upload a text, DOC, DOCX, or PDF file.');
4646
setFile(null);
47-
setFileContent('');
47+
setFileContent('');
4848
toast.error("Unsupported File", { description: "Please upload a document file (TXT, DOC, DOCX, PDF)." });
4949
}
5050
}
@@ -96,7 +96,7 @@ const AiSuggestToolPage = () => {
9696
const handleRemoveSuggestion = (indexToRemove: number) => {
9797
setSuggestions(prev => prev.filter((_, index) => index !== indexToRemove));
9898
toast("Tool removed", { description: "The tool has been removed from the suggestion list." });
99-
};
99+
};
100100

101101
const handleAddAllToCart = () => {
102102
if (suggestions.length === 0) {
@@ -120,18 +120,18 @@ const AiSuggestToolPage = () => {
120120
<div className="container mx-auto px-4 py-8">
121121
<Card className="max-w-2xl mx-auto">
122122
<CardHeader>
123-
<CardTitle className="text-2xl font-bold font-headline">AI Tool Suggester</CardTitle>
124-
<CardDescription>Describe your project or upload a document, and our AI will suggest suitable tools.</CardDescription>
123+
<CardTitle className="text-2xl font-bold font-headline">AI แนะนำเครื่องมือ</CardTitle>
124+
<CardDescription>อธิบายโปรเจกต์ของคุณ หรืออัปโหลดเอกสาร แล้ว AI ของเราจะแนะนำเครื่องมือที่เหมาะสมให้</CardDescription>
125125
</CardHeader>
126126
<form onSubmit={handleSubmit}>
127127
<CardContent className="space-y-6">
128128
<Tabs value={inputType} onValueChange={(value) => { setInputType(value as 'text' | 'file'); setError(null); setSuggestions([]); }} className="w-full">
129129
<TabsList className="grid w-full grid-cols-2">
130130
<TabsTrigger value="text">
131-
<Type className="mr-2 h-5 w-5" /> Text Input
131+
<Type className="mr-2 h-5 w-5" /> ป้อนข้อความ
132132
</TabsTrigger>
133133
<TabsTrigger value="file">
134-
<UploadCloud className="mr-2 h-5 w-5" /> File Upload
134+
<UploadCloud className="mr-2 h-5 w-5" /> อัปโหลดไฟล์
135135
</TabsTrigger>
136136
</TabsList>
137137
<TabsContent value="text" className="pt-4">
@@ -146,7 +146,7 @@ const AiSuggestToolPage = () => {
146146
/>
147147
</TabsContent>
148148
<TabsContent value="file" className="pt-4">
149-
<Label htmlFor="project-document-input" className="block text-sm font-medium mb-2">Upload your project plan or brief</Label>
149+
<Label htmlFor="project-document-input" className="block text-sm font-medium mb-2">อัปโหลดแผนงานหรือสรุปโครงการของคุณ</Label>
150150
<div className="mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-dashed rounded-md hover:border-primary transition-colors">
151151
<div className="space-y-1 text-center">
152152
<UploadCloud className="mx-auto h-10 w-10 text-muted-foreground" />
@@ -155,12 +155,12 @@ const AiSuggestToolPage = () => {
155155
htmlFor="project-document-input-inner"
156156
className="relative cursor-pointer rounded-md font-medium text-primary hover:text-primary/80 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-primary"
157157
>
158-
<span>Upload a file</span>
158+
<span>อัปโหลดไฟล์</span>
159159
<Input id="project-document-input-inner" name="project-document" type="file" className="sr-only" onChange={handleFileChange} accept=".txt,.doc,.docx,.pdf" />
160160
</Label>
161-
<p className="pl-1">or drag and drop</p>
161+
<p className="pl-1">หรือลากและวาง</p>
162162
</div>
163-
<p className="text-xs text-muted-foreground">TXT, DOC, DOCX, PDF files up to 5MB</p>
163+
<p className="text-xs text-muted-foreground">ไฟล์ TXT, DOC, DOCX, PDF ขนาดไม่เกิน 5MB</p>
164164
</div>
165165
</div>
166166
{file && (
@@ -170,7 +170,7 @@ const AiSuggestToolPage = () => {
170170
<span className="text-sm font-medium">{file.name}</span>
171171
<span className="text-xs text-muted-foreground">({(file.size / 1024).toFixed(1)} KB)</span>
172172
</div>
173-
<Button variant="ghost" size="sm" onClick={() => { setFile(null); setFileContent(''); setError(null); }}>Clear</Button>
173+
<Button variant="ghost" size="sm" onClick={() => { setFile(null); setFileContent(''); setError(null); }}>ล้าง</Button>
174174
</div>
175175
)}
176176
</TabsContent>
@@ -179,7 +179,7 @@ const AiSuggestToolPage = () => {
179179
{error && (
180180
<div className="p-3 bg-destructive/10 border border-destructive/30 rounded-md text-destructive flex items-center">
181181
<AlertTriangle className="h-5 w-5 mr-2" />
182-
<p className="text-sm font-medium">{error}</p>
182+
<p className="text-sm font-medium">{error}</p>
183183
</div>
184184
)}
185185

@@ -195,7 +195,7 @@ const AiSuggestToolPage = () => {
195195
{suggestions.length > 0 && (
196196
<div className="mt-6 pt-6 border-t">
197197
<div className="flex justify-between items-center mb-3">
198-
<h3 className="text-lg font-semibold font-headline">Suggested Tools:</h3>
198+
<h3 className="text-lg font-semibold font-headline">เครื่องมือแนะนำ:</h3>
199199
</div>
200200
<div className="space-y-2 bg-secondary/30 p-4 rounded-md">
201201
<ul className="space-y-1">
@@ -216,7 +216,7 @@ const AiSuggestToolPage = () => {
216216
</ul>
217217
<Button onClick={handleAddAllToCart} className="w-full mt-3">
218218
<ShoppingCart className="mr-2 h-4 w-4" />
219-
Add All to Cart ({suggestions.length})
219+
เพิ่มทั้งหมดลงในรถเข็น ({suggestions.length})
220220
</Button>
221221
</div>
222222
</div>

src/app/blog/[slug]/page.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const BlogPage = () => {
5757

5858

5959
if (!article) {
60-
return <div className="container mx-auto px-4 py-8 text-center">Loading article...</div>;
60+
return <div className="container mx-auto px-4 py-8 text-center">กำลังโหลดบทความ...</div>;
6161
}
6262

6363
const handleTocClick = (id: string, e: React.MouseEvent) => {
@@ -79,39 +79,39 @@ const BlogPage = () => {
7979
<header className="mb-8">
8080
<div className="flex flex-col md:flex-row justify-between md:items-center gap-4 mb-3">
8181
<h1 className="font-headline text-3xl sm:text-4xl lg:text-5xl font-bold leading-tight flex-1">
82-
{article.title}
82+
{article.title}
8383
</h1>
8484
{article.relatedProducts && article.relatedProducts.length > 0 && (
8585
<Button asChild variant="default" size="sm" className="shrink-0">
8686
<Link href={`/equipment?filter_preset=${article.slug}`}>
87-
<ListChecks className="mr-2 h-4 w-4" /> ดูรายการสินค้า
87+
<ListChecks className="mr-2 h-4 w-4" /> ดูรายการสินค้า
8888
</Link>
8989
</Button>
9090
)}
9191
</div>
92-
92+
9393
{article.subtitle && <p className="text-lg lg:text-xl text-muted-foreground mb-4">{article.subtitle}</p>}
9494

9595
<div className="flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground mb-2">
9696
{article.date && <span className="flex items-center"><CalendarDays className="h-4 w-4 mr-1.5 text-primary" /> Published: {new Date(article.date).toLocaleDateString()}</span>}
9797
</div>
9898
<div className="flex flex-wrap gap-2">
9999
<Badge variant="secondary" className="text-xs"><Zap className="h-3 w-3 mr-1" /> {article.difficulty}</Badge>
100-
<Badge variant="secondary" className="text-xs"><Clock className="h-3 w-3 mr-1" /> {article.duration}</Badge>
101-
<Badge variant="secondary" className="text-xs"><DollarSign className="h-3 w-3 mr-1" /> Cost: {article.cost}</Badge>
100+
<Badge variant="secondary" className="text-xs"><Clock className="h-3 w-3 mr-1" /> ระยะเวลา: {article.duration}</Badge>
101+
<Badge variant="secondary" className="text-xs"><DollarSign className="h-3 w-3 mr-1" /> ค่าใช้จ่าย: {article.cost}</Badge>
102102
</div>
103103
</header>
104104

105105
<div className="lg:grid lg:grid-cols-[280px_1fr] lg:gap-12">
106106
{/* Table of Contents (Desktop) - Roadmap Style */}
107107
{article.toc && article.toc.length > 0 && (
108108
<aside className="hidden lg:block sticky top-24 self-start border rounded-lg p-4 max-h-[calc(100vh-10rem)] overflow-y-auto">
109-
<h2 className="text-lg font-semibold mb-4 font-headline">Table of Contents</h2>
109+
<h2 className="text-lg font-semibold mb-4 font-headline">สารบัญ</h2>
110110
<div className="relative"> {/* Wrapper for the line and list */}
111111
{/* Main vertical line: 8px from the left of this div */}
112-
<div
112+
<div
113113
className="absolute left-2 top-0 bottom-0 w-0.5 bg-border z-0"
114-
aria-hidden="true"
114+
aria-hidden="true"
115115
></div>
116116
<ul className="relative z-10">
117117
{article.toc.map(item => (
@@ -120,7 +120,7 @@ const BlogPage = () => {
120120
className="relative"
121121
// Hierarchical indentation: each level adds 1rem.
122122
style={{ paddingLeft: `${(item.level - 2) * 1}rem` }}
123-
>
123+
>
124124
<a
125125
href={`#${item.id}`}
126126
onClick={(e) => handleTocClick(item.id, e)}
@@ -135,15 +135,15 @@ const BlogPage = () => {
135135
{/* Dot: positioned to sit on the main vertical line */}
136136
<span
137137
className={cn(
138-
"absolute top-1/2 -translate-y-1/2 h-2.5 w-2.5 rounded-full border",
138+
"absolute top-1/2 -translate-y-1/2 h-2.5 w-2.5 rounded-full border",
139139
"left-[3px]", // Dot's left edge is 3px from li's content box start, centering 10px dot on 8px line
140140
activeTocId === item.id
141141
? "bg-primary border-primary ring-1 ring-primary/40 ring-offset-1 ring-offset-background"
142142
: "bg-card border-muted group-hover:border-primary"
143143
)}
144144
aria-hidden="true"
145145
>
146-
</span>
146+
</span>
147147
<span className="leading-tight">{item.title}</span>
148148
</a>
149149
</li>
@@ -157,7 +157,7 @@ const BlogPage = () => {
157157
<div className="prose prose-lg max-w-none dark:prose-invert prose-headings:font-headline prose-a:text-primary hover:prose-a:underline prose-img:rounded-md prose-img:shadow-md" ref={contentRef}>
158158
<div className="relative aspect-video rounded-lg overflow-hidden mb-8 shadow-xl">
159159
<Image src={article.thumbnail} alt={article.title} layout="fill" objectFit="cover" priority data-ai-hint={article.aiHint || "blog header"} />
160-
</div>
160+
</div>
161161

162162
<div dangerouslySetInnerHTML={{ __html: article.content || '<p>Content not available.</p>' }} />
163163
</div>
@@ -167,9 +167,9 @@ const BlogPage = () => {
167167
{article.relatedProducts && article.relatedProducts.length > 0 && (
168168
<section className="mt-12 pt-8 border-t">
169169
<div className="flex justify-between items-center mb-6">
170-
<h2 className="font-headline text-2xl font-bold">ของที่ต้องใช้</h2>
170+
<h2 className="font-headline text-2xl font-bold">ของที่ต้องใช้</h2>
171171
<Button variant="default">
172-
<ShoppingCart className="mr-2 h-4 w-4" /> Add All to Cart
172+
<ShoppingCart className="mr-2 h-4 w-4" /> เพิ่มทั้งหมดลงในตะกร้า
173173
</Button>
174174
</div>
175175
<ScrollArea className="w-full pb-4">

src/app/blog/page.tsx

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const BlogListPage = () => {
3333
if (difficultyFilter !== 'all') {
3434
tempArticles = tempArticles.filter(article => article.difficulty.toLowerCase() === difficultyFilter);
3535
}
36-
36+
3737
setFilteredArticles(tempArticles);
3838
setCurrentPage(1); // Reset to first page on filter change
3939
}, [searchTerm, categoryFilter, difficultyFilter]);
@@ -44,7 +44,7 @@ const BlogListPage = () => {
4444
const FilterControls = () => (
4545
<div className="space-y-4">
4646
<div>
47-
<label htmlFor="search-blog" className="block text-sm font-medium mb-1">Search Articles</label>
47+
<label htmlFor="search-blog" className="block text-sm font-medium mb-1">ค้นหาบทความ</label>
4848
<div className="relative">
4949
<Input
5050
id="search-blog"
@@ -58,32 +58,33 @@ const BlogListPage = () => {
5858
</div>
5959
</div>
6060
<div>
61-
<label htmlFor="difficulty-filter" className="block text-sm font-medium mb-1">Difficulty</label>
61+
<label htmlFor="difficulty-filter" className="block text-sm font-medium mb-1">ระดับความยาก</label>
6262
<Select value={difficultyFilter} onValueChange={setDifficultyFilter}>
6363
<SelectTrigger id="difficulty-filter">
64-
<SelectValue placeholder="Filter by difficulty" />
64+
<SelectValue placeholder="กรองตามระดับความยาก" />
6565
</SelectTrigger>
6666
<SelectContent>
67-
<SelectItem value="all">All Difficulties</SelectItem>
67+
<SelectItem value="all">ทุกระดับความยาก</SelectItem>
6868
<SelectItem value="easy">Easy</SelectItem>
6969
<SelectItem value="medium">Medium</SelectItem>
7070
<SelectItem value="hard">Hard</SelectItem>
7171
</SelectContent>
7272
</Select>
7373
</div>
74-
{/* Placeholder for category filter */}
74+
{/* Placeholder for category filter */}
7575
<div>
76-
<label htmlFor="category-filter" className="block text-sm font-medium mb-1">Category</label>
76+
<label htmlFor="category-filter" className="block text-sm font-medium mb-1">หมวดหมู่</label>
7777
<Select value={categoryFilter} onValueChange={setCategoryFilter} disabled>
7878
<SelectTrigger id="category-filter">
79-
<SelectValue placeholder="Filter by category (soon)" />
79+
<SelectValue placeholder="กรองตามหมวดหมู่ (เร็วๆ นี้)" />
8080
</SelectTrigger>
8181
<SelectContent>
82-
<SelectItem value="all">All Categories</SelectItem>
82+
<SelectItem value="all">ทุกหมวดหมู่</SelectItem>
8383
{/* Populate with actual categories */}
8484
</SelectContent>
8585
</Select>
8686
</div>
87+
8788
</div>
8889
);
8990

@@ -92,9 +93,9 @@ const BlogListPage = () => {
9293
<div className="container mx-auto px-4 py-8">
9394
<header className="mb-10 text-center">
9495
<BookOpenText className="h-16 w-16 mx-auto text-primary mb-4" />
95-
<h1 className="text-4xl font-bold font-headline mb-2">Blog Articles</h1>
96+
<h1 className="text-4xl font-bold font-headline mb-2">บทความน่าสนใจ</h1>
9697
<p className="text-lg text-muted-foreground max-w-2xl mx-auto">
97-
Find tips, guides, and inspiration for your next project. Learn how to use tools 효과적으로 and safely.
98+
ค้นพบเคล็ดลับ คู่มือ และแรงบันดาลใจสำหรับโปรเจกต์ต่อไปของคุณ เรียนรู้วิธีใช้เครื่องมืออย่างมีประสิทธิภาพและปลอดภัย
9899
</p>
99100
</header>
100101

@@ -111,16 +112,18 @@ const BlogListPage = () => {
111112
<Sheet>
112113
<SheetTrigger asChild>
113114
<Button variant="outline" className="w-full">
114-
<ListFilter className="mr-2 h-4 w-4" /> Filters
115-
</Button>
115+
<ListFilter className="mr-2 h-4 w-4" /> Filters</Button>
116+
116117
</SheetTrigger>
117118
<SheetContent side="left" className="w-[300px] overflow-y-auto p-4">
119+
118120
<h2 className="text-xl font-semibold mb-4 font-headline">Filters</h2>
119121
<FilterControls />
120122
</SheetContent>
123+
121124
</Sheet>
122125
</div>
123-
126+
124127
{paginatedArticles.length > 0 ? (
125128
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
126129
{paginatedArticles.map(article => (
@@ -129,7 +132,7 @@ const BlogListPage = () => {
129132
</div>
130133
) : (
131134
<div className="text-center py-12">
132-
<p className="text-xl text-muted-foreground">No articles found matching your criteria.</p>
135+
<p className="text-xl text-muted-foreground">ไม่พบบทความที่ตรงกับเกณฑ์ของคุณ</p>
133136
</div>
134137
)}
135138

@@ -140,17 +143,17 @@ const BlogListPage = () => {
140143
onClick={() => setCurrentPage(p => Math.max(1, p - 1))}
141144
disabled={currentPage === 1}
142145
>
143-
Previous
146+
ก่อนหน้า
144147
</Button>
145148
<span className="text-sm text-muted-foreground">
146-
Page {currentPage} of {totalPages}
149+
หน้า {currentPage} จาก {totalPages}
147150
</span>
148151
<Button
149152
variant="outline"
150153
onClick={() => setCurrentPage(p => Math.min(totalPages, p + 1))}
151154
disabled={currentPage === totalPages}
152155
>
153-
Next
156+
ถัดไป
154157
</Button>
155158
</div>
156159
)}

0 commit comments

Comments
 (0)