Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
811f3340
Unverified
Commit
811f3340
authored
Sep 16, 2022
by
f97
Committed by
GitHub
Sep 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add vietnamese (#218)
parent
7e8d1128
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
138 additions
and
2 deletions
+138
-2
user_setting.go
api/user_setting.go
+1
-1
PreferencesSection.tsx
web/src/components/Settings/PreferencesSection.tsx
+4
-0
useI18n.ts
web/src/labs/i18n/useI18n.ts
+2
-0
vi.json
web/src/locales/vi.json
+126
-0
Auth.tsx
web/src/pages/Auth.tsx
+4
-0
i18n.d.ts
web/src/types/i18n.d.ts
+1
-1
No files found.
api/user_setting.go
View file @
811f3340
...
...
@@ -30,7 +30,7 @@ func (key UserSettingKey) String() string {
}
var
(
UserSettingLocaleValue
=
[]
string
{
"en"
,
"zh"
}
UserSettingLocaleValue
=
[]
string
{
"en"
,
"zh"
,
"vi"
}
UserSettingMemoVisibilityValue
=
[]
Visibility
{
Privite
,
Protected
,
Public
}
UserSettingEditorFontStyleValue
=
[]
string
{
"normal"
,
"mono"
}
)
...
...
web/src/components/Settings/PreferencesSection.tsx
View file @
811f3340
...
...
@@ -15,6 +15,10 @@ const localeSelectorItems = [
text
:
"中文"
,
value
:
"zh"
,
},
{
text
:
"Tiếng Việt"
,
value
:
"vi"
,
},
];
const
editorFontStyleSelectorItems
=
[
...
...
web/src/labs/i18n/useI18n.ts
View file @
811f3340
...
...
@@ -2,10 +2,12 @@ import { useEffect, useState } from "react";
import
i18nStore
from
"./i18nStore"
;
import
enLocale
from
"../../locales/en.json"
;
import
zhLocale
from
"../../locales/zh.json"
;
import
viLocale
from
"../../locales/vi.json"
;
const
resources
:
Record
<
string
,
any
>
=
{
en
:
enLocale
,
zh
:
zhLocale
,
vi
:
viLocale
,
};
const
useI18n
=
()
=>
{
...
...
web/src/locales/vi.json
0 → 100644
View file @
811f3340
{
"common"
:
{
"about"
:
"Thông Tin"
,
"email"
:
"Email"
,
"password"
:
"Mật khẩu"
,
"new-password"
:
"Mật khẩu mới"
,
"repeat-new-password"
:
"Nhập lại mật khẩu mới"
,
"username"
:
"Tên đăng nhập"
,
"save"
:
"Lưu"
,
"cancel"
:
"Hủy"
,
"create"
:
"Tạo mới"
,
"change"
:
"Thay đổi"
,
"reset"
:
"Khôi phục"
,
"language"
:
"Ngôn Ngữ"
,
"version"
:
"Phiên bản"
,
"pin"
:
"Gắn lên trên cùng"
,
"unpin"
:
"Gỡ khỏi vị trị trên cùng"
,
"edit"
:
"Chỉnh sửa"
,
"restore"
:
"Khôi phục"
,
"delete"
:
"Xóa"
,
"null"
:
"Null"
,
"share"
:
"Chia sẻ"
,
"mark"
:
"Đánh dấu"
,
"archive"
:
"Lưu trữ"
,
"basic"
:
"Cơ bản"
,
"admin"
:
"Admin"
,
"explore"
:
"Khám phá"
,
"sign-in"
:
"Đăng nhập"
,
"sign-out"
:
"Đăng xuất"
,
"back-to-home"
:
"Quay về trang chủ"
,
"type"
:
"Kiểu"
,
"shortcuts"
:
"Lối tắt"
,
"shortcut-title"
:
"Tên lối tắt"
,
"title"
:
"Tên"
,
"filter"
:
"Bộ lọc"
,
"tags"
:
"Thẻ"
,
"no-memos"
:
"Không có memo nào 🌃"
,
"memos-ready"
:
"Tất cả memo ở đây rồi 🎉"
,
"yourself"
:
"Của bạn"
,
"archived-at"
:
"Lưu trữ lúc"
,
"restored-successfully"
:
"Đã khôi phục thành công"
,
"memo-updated-datetime"
:
"Memo đã thay đổi ngày giờ tạo."
,
"invalid-created-datetime"
:
"Ngày giờ tạo không hợp lệ."
,
"change-memo-created-time"
:
"Thay đổi thời gian tạo memo"
,
"memo-not-found"
:
"Không tìm thấy memo."
,
"fill-all"
:
"Vui lòng nhập tất cả các mục."
,
"new-password-not-match"
:
"Mật khẩu mới không giống nhau."
,
"changed"
:
"đã thay đổi"
,
"image-load-failed"
:
"Tải ảnh bị lỗi"
,
"fill-form"
:
"Please fill out this form"
,
"login-failed"
:
"Đăng nhập thất bại"
,
"signup-failed"
:
"Đăng ký thất bại"
,
"user-not-found"
:
"Không tìm thấy người dùng này"
},
"slogan"
:
"Một mã nguồn mở, tự lưu lại mọi thứ bạn biết dựa trên SQLite db."
,
"auth"
:
{
"signup-as-host"
:
"Đăng ký như chủ nhân"
,
"host-tip"
:
"Bạn đang đăng ký với tư cách chủ nhân của trang web này."
,
"not-host-tip"
:
"Nếu chưa có tài khoản, bạn cần phải liên hệ chủ nhân của trang web."
},
"sidebar"
:
{
"daily-review"
:
"Đánh giá hàng ngày"
,
"resources"
:
"Tài nguyên"
,
"setting"
:
"Cài đặt"
,
"archived"
:
"Lưu"
},
"daily-review"
:
{
"oops-nothing"
:
"Oops, chẳng có gì ở đây cả."
},
"resources"
:
{
"description"
:
"Xem toàn bộ tài nguyên của trang web. ví dụ hình ảnh"
,
"no-resources"
:
"Không có tài nguyên."
,
"fetching-data"
:
"đang tải dữ liệu..."
,
"upload"
:
"Tải lên"
,
"preview"
:
"Xem trước"
,
"copy-link"
:
"Sao chép"
},
"archived"
:
{
"archived-memos"
:
"Memo đã lưu trữ"
,
"no-archived-memos"
:
"Không có memo nào cả."
,
"fetching-data"
:
"đang tải dữ liệu..."
},
"editor"
:
{
"editing"
:
"Đang chỉnh sửa..."
,
"save"
:
"Lưu"
,
"placeholder"
:
"Bất cứ gì bạn đang nghĩ..."
,
"only-image-supported"
:
"Chỉ hỗ trợ hình ảnh."
,
"cant-empty"
:
"Nội dung không thể trống"
},
"memo"
:
{
"view-story"
:
"Xem nội dung"
},
"memo-list"
:
{
"fetching-data"
:
"đang tải dữ liệu..."
},
"shortcut-list"
:
{
"create-shortcut"
:
"Tạo lối tắt"
,
"edit-shortcut"
:
"Chỉnh sửa lối tắt"
,
"new-filter"
:
"Bộ lọc mới"
,
"eligible-memo"
:
"memo đạt chuẩn"
,
"fill-previous"
:
"Vui lòng nhập vào giá trị của bộ lọc trước đó"
,
"title-required"
:
"Tiêu đề là bắt buộc"
},
"tag-list"
:
{
"tip-text"
:
"Nhập `#tag` để tạo mới"
},
"search"
:
{
"quickly-filter"
:
"Lọc nhanh"
},
"setting"
:
{
"my-account"
:
"Tài khoản"
,
"preference"
:
"Sở thích"
,
"member"
:
"Thành viên"
,
"member-list"
:
"Danh sách thành viên"
,
"account-section"
:
{
"title"
:
"Thông tin tài khoản"
},
"preference-section"
:
{
"default-memo-visibility"
:
"Chế độ memo mặc định"
,
"editor-font-style"
:
"Thay đổi font cho trình soạn thảo"
},
"member-section"
:
{
"create-a-member"
:
"Tạo một thành viên"
}
}
}
web/src/pages/Auth.tsx
View file @
811f3340
...
...
@@ -162,6 +162,10 @@ const Auth = () => {
<
span
className=
{
`locale-item ${locale === "zh" ? "active" : ""}`
}
onClick=
{
()
=>
handleLocaleItemClick
(
"zh"
)
}
>
中文
</
span
>
<
span
className=
"split-line"
>
/
</
span
>
<
span
className=
{
`locale-item ${locale === "vi" ? "active" : ""}`
}
onClick=
{
()
=>
handleLocaleItemClick
(
"vi"
)
}
>
Tiếng Việt
</
span
>
</
div
>
</
div
>
</
div
>
...
...
web/src/types/i18n.d.ts
View file @
811f3340
type
Locale
=
"en"
|
"zh"
;
type
Locale
=
"en"
|
"zh"
|
"vi"
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment