Skip to content

Commit 3be44a1

Browse files
authored
Merge pull request #61 from Daishaojie111/main
Internationalization of Chinese and English
2 parents a7c41d9 + b025621 commit 3be44a1

37 files changed

+497
-202
lines changed

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"i18n-ally.localesPaths": [
3+
"src/lib/langs"
4+
]
5+
}

src/lib/common/LanguageDropdown.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
<Dropdown {isOpen} toggle={() => (isOpen = !isOpen)} class="d-inline-block">
3030
<DropdownToggle class="btn header-item" tag="button" color="">
3131
<img
32-
src='images/flags/us.jpg'
33-
alt="Samply"
34-
height="16"
32+
src={languages.find(lang => lang.value === selectedLang)?.flag || 'images/flags/us.jpg'}
33+
alt="Language"
34+
height="16"
3535
/>
3636
</DropdownToggle>
3737
<DropdownMenu class="language-switch dropdown-menu-end">

src/lib/common/NotificationDropdown.svelte

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { Dropdown, DropdownToggle, DropdownMenu } from '@sveltestrap/sveltestrap';
44
import "overlayscrollbars/overlayscrollbars.css";
55
import { OverlayScrollbars } from "overlayscrollbars";
6+
import { _ } from 'svelte-i18n'
67
78
import { onMount } from 'svelte';
89
@@ -33,10 +34,10 @@
3334
<div class="p-3">
3435
<div class="row align-items-center">
3536
<div class="col">
36-
<h6 class="m-0">Notifications</h6>
37+
<h6 class="m-0">{$_('Notifications')}</h6>
3738
</div>
3839
<div class="col-auto">
39-
<Link href="#!" class="small">View All</Link>
40+
<Link href="#!" class="small">{$_('View All')}</Link>
4041
</div>
4142
</div>
4243
</div>
@@ -49,11 +50,11 @@
4950
</span>
5051
</div>
5152
<div class="flex-grow-1">
52-
<h6 class="mb-1" >Your order is placed</h6>
53+
<h6 class="mb-1" >{$_('Your order is placed')}</h6>
5354
<div class="font-size-12 text-muted">
54-
<p class="mb-1" >If several languages coalesce the grammar</p>
55+
<p class="mb-1" >{$_('If several languages coalesce the grammar')}</p>
5556
<p class="mb-0">
56-
<i class="mdi mdi-clock-outline" /> <span >3 min ago</span>
57+
<i class="mdi mdi-clock-outline" /> <span >3 {$_('min ago')}</span>
5758
</p>
5859
</div>
5960
</div>

src/lib/common/ProfileDropdown.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<!-- item-->
3232
<DropdownItem href="page/user/me"
3333
><i class="bx bx-user font-size-16 align-middle me-1" />
34-
<span>Profile</span>
34+
<span>{$_('Profile')}</span>
3535
</DropdownItem>
3636
<DropdownItem href="#"
3737
><span class="badge bg-success float-end">11</span><i
@@ -41,7 +41,7 @@
4141
<DropdownItem divider />
4242
<DropdownItem href="#" on:click={logout}>
4343
<div>
44-
<i class="bx bx-power-off font-size-16 align-middle me-1 text-danger" /> <span>Logout</span>
44+
<i class="bx bx-power-off font-size-16 align-middle me-1 text-danger" /> <span>{$_('Logout')}</span>
4545
</div>
4646
</DropdownItem>
4747
</DropdownMenu>

src/lib/common/TablePagination.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script>
22
import { onMount } from 'svelte';
3-
import Link from 'svelte-link';
3+
import Link from 'svelte-link';
4+
import { _ } from 'svelte-i18n'
45
56
/** @type {import('$lib/helpers/types').Pagination} */
67
export let pagination;
@@ -44,7 +45,7 @@
4445

4546
<div class="row justify-content-between align-items-center">
4647
<div class="col-auto me-auto">
47-
<p class="text-muted mb-0">Showing <b>{start}</b> to <b>{end}</b> of <b>{pagination.count}</b> entries</p>
48+
<p class="text-muted mb-0">{$_('Showing')} <b>{start}</b> {$_('to')} <b>{end}</b> {$_('of')} <b>{pagination.count}</b> {$_('entries')}</p>
4849
</div>
4950
<div class="col-auto">
5051
<div class="card d-inline-block ms-auto mb-0">

src/lib/common/data/languages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const languages = [
55
value: 'en'
66
},
77
{
8-
label: "Chinese",
8+
label: "中文",
99
flag: 'images/flags/china.png',
1010
value: 'zh'
1111
},

src/lib/langs/en.json

Lines changed: 132 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,20 @@
5454
"Project Overview": "Project Overview",
5555
"Create New": "Create New",
5656
"Tasks": "Tasks",
57-
"Task List": "Task List",
5857
"Kanban Board": "Kanban Board",
5958
"Create Task": "Create Task",
6059
"Contacts": "Contacts",
6160
"User Grid": "User Grid",
6261
"User List": "User List",
6362
"Edit Details": "Edit Details",
64-
"Profile": "Profile",
6563
"Blog List": "Blog List",
6664
"Blog Grid": "Blog Grid",
6765
"Blog Details": "Blog Details",
68-
"Conversation List": "Conversation List",
6966
"Job Grid": "Job Grid",
7067
"Apply Job": "Apply Job",
7168
"Job Details": "Job Details",
7269
"Jobs Categories": "Jobs Categories",
7370
"Candidate": "Candidate",
74-
"List": "List",
7571
"Overview": "Overview",
7672
"Pages": "Pages",
7773
"Authentication": "Authentication",
@@ -106,7 +102,6 @@
106102
"Carousel": "Carousel",
107103
"Dropdowns": "Dropdowns",
108104
"Grid": "Grid",
109-
"Images": "Images",
110105
"Lightbox": "Lightbox",
111106
"Modals": "Modals",
112107
"Offcanvas": "Offcanvas",
@@ -116,12 +111,10 @@
116111
"Sweet-Alert": "Sweet-Alert",
117112
"Tabs & Accordions": "Tabs & Accordions",
118113
"Typography": "Typography",
119-
"Video": "Video",
120114
"General": "General",
121115
"Colors": "Colors",
122116
"Utilities": "Utilities",
123117
"Rating": "Rating",
124-
"Notifications": "Notifications",
125118
"Image Cropper": "Image Cropper",
126119
"Forms": "Forms",
127120
"Forms Elements": "Forms Elements",
@@ -169,14 +162,143 @@
169162
"UI Components": "UI Components",
170163
"Applications": "Applications",
171164
"View all": "View all",
172-
"Your order is placed": "Your order is placed",
173165
"If several languages ​​coalesce the grammar": "If several languages ​​coalesce the grammar",
174166
"3 min ago": "3 min ago",
175167
"It will seem like simplified English": "It will seem like simplified English",
176168
"Your item is shipped": "Your item is shipped",
177169
"As a skeptical Cambridge friend of mine occidental": "As a skeptical Cambridge friend of mine occidental",
178170
"1 hours ago": "1 hours ago",
179-
"View More": "View More",
171+
172+
"Agents":"Agents",
173+
"Evaluator":"Evaluator",
174+
"Router":"Router",
175+
"Home":"Home",
176+
"Dashboard":"Dashboard",
177+
"Agent":"Agent",
178+
"Knowledge Base":"Knowledge Base",
179+
"Conversation":"Conversation",
180+
"Task":"Task",
181+
"MongoDB":"MongoDB",
182+
"Plugins":"Plugins",
180183
"Settings": "Settings",
181-
"Logout": "Logout"
184+
"Search":"Search",
185+
"Welcome Back !":"Welcome Back !",
186+
"Admin":"Admin",
187+
"Agent Manager":"Agent Manager",
188+
"Conversations":"Conversations",
189+
"Token Cost":"Token Cost",
190+
"View Profile":"View Profile",
191+
"Monthly Cost":"Monthly Cost",
192+
"This month":"This month",
193+
"View More": "View More",
194+
"Total Cost":"Total Cost",
195+
"Average Cost":"Average Cost",
196+
"Week":"Week",
197+
"Month":"Month",
198+
"Year":"Year",
199+
"Token Spent":"Token Spent",
200+
"Channel Stats":"Channel Stats",
201+
"Learn more":"Learn more",
202+
"sales":"sales",
203+
"Activity":"Activity",
204+
"Read more":"Read more",
205+
"Top Client Usage":"Top Client Usage",
206+
"Logout": "Logout",
207+
"Profile": "Profile",
208+
"Notifications": "Notifications",
209+
"View All":"View All",
210+
"Your order is placed": "Your order is placed",
211+
"min ago":"min ago",
212+
"List": "List",
213+
"Communication":"Communication",
214+
"Conversation List": "Conversation List",
215+
"Task List": "Task List",
216+
"Knowledge Manager":"Knowledge Manager",
217+
"Migrate agents from file repository to MongoDB":"Migrate agents from file repository to MongoDB",
218+
"Setting":"Setting",
219+
"Start Migration":"Start Migration",
220+
"Plugin":"Plugin",
221+
"My Profile":"My Profile",
222+
"Detail":"Detail",
223+
"System & Plugin Settings":"System & Plugin Settings",
224+
"Disabled":"Disabled",
225+
"Enabled":"Enabled",
226+
"Public":"Public",
227+
"Private":"Private",
228+
"Build":"Build",
229+
"Train":"Train",
230+
"Test":"Test",
231+
"My Files":"My Files",
232+
"Upload":"Upload",
233+
"Recent Files":"Recent Files",
234+
"Storage":"Storage",
235+
"0 GB (0%) of 1 GB used":"0 GB (0%) of 1 GB used",
236+
"Provided by BotSharp":"Provided by BotSharp",
237+
"Provided by Pizza AI Assistant":"Provided by Pizza AI Assistant",
238+
"Upgrade Features":"Upgrade Features",
239+
"Upgrade":"Upgrade",
240+
"Files":"Files",
241+
"Design":"Design",
242+
"Google Drive":"Google Drive",
243+
"Starred":"Starred",
244+
"Trash":"Trash",
245+
"Dropbox":"Dropbox",
246+
"Open":"Open",
247+
"Edit":"Edit" ,
248+
"Rename":"Rename",
249+
"Remove":"Remove",
250+
"Share Files":"Share Files",
251+
"Share with me":"Share with me",
252+
"Other Actions":"Other Actions",
253+
"Name":"Name",
254+
"Date modified":"Date modified",
255+
"Size":"Size",
256+
"Images": "Images",
257+
"Video": "Video",
258+
"Music":"Music",
259+
"Document":"Document",
260+
"Others":"Others",
261+
"Another action":"Another action",
262+
"Something else here":"Something else here",
263+
"Search for ...":"Search for ...",
264+
"Status":"Status",
265+
"Completed":"Completed",
266+
"Select Channel":"Select Channel",
267+
"Live Chat":"Live Chat",
268+
"Phone":"Phone",
269+
"Email":"Email",
270+
"Filter":"Filter",
271+
"Title":"Title",
272+
"User Name":"User Name",
273+
"Channel":"Channel",
274+
"Posted Date":"Posted Date",
275+
"Last Date":"Last Date",
276+
"Action":"Action",
277+
"Active":"Active",
278+
"Description":"Description",
279+
"Details":"Details",
280+
"Updated Date":"Updated Date",
281+
"Showing":"Showing",
282+
"of":"of",
283+
"to":"to",
284+
"entries":"entries",
285+
"View":"View",
286+
"Install":"Install",
287+
"Dialogs":"Dialogs",
288+
"Agent Overview":"Agent Overview",
289+
"Save Agent":"Save Agent",
290+
"Conversation Detail":"Conversation Detail",
291+
"closed":"closed",
292+
"webchat":"webchat",
293+
"User":"User",
294+
"Location":"Location",
295+
"Delete Conversation":" Delete Conversation",
296+
"Design & Developed by open source community":"Design & Developed by open source community",
297+
"Personal Information":"Personal Information",
298+
"First Name":"First Name",
299+
"Last Name":"Last Name",
300+
"Account Origin":"Account Origin",
301+
"Update Date":"Update Date",
302+
"Create Date":"Create Date",
303+
"Active now":"Active now"
182304
}

0 commit comments

Comments
 (0)