feat: add Vietnamese translation (#548)
Some checks failed
Code quality / quality (push) Failing after 11s
Build and Check / Astro Check for Node.js 22 (push) Failing after 6s
Build and Check / Astro Check for Node.js 23 (push) Failing after 5s
Build and Check / Astro Build for Node.js 22 (push) Failing after 4s
Build and Check / Astro Build for Node.js 23 (push) Failing after 5s

* Create vi.ts

Create i18n Vietnamese translation file.

* Update translation.ts

Added Vietnamese language support.

* Update config.ts

Add Vietnamese (vi) to be a possible value for the `lang` key.

* Create README.vi.md

Created Vietnamese version of README.

* Update README.md

Added navigation/link to Vietnamese version of README.

* Update README.md

fixed a mistake
This commit is contained in:
Yapper
2025-07-27 11:14:43 +07:00
committed by GitHub
parent 2b9e9ff903
commit 4382cdcc08
5 changed files with 128 additions and 2 deletions

View File

@@ -10,7 +10,7 @@ import { LinkPreset } from "./types/config";
export const siteConfig: SiteConfig = {
title: "Fuwari",
subtitle: "Demo Site",
lang: "en", // 'en', 'zh_CN', 'zh_TW', 'ja', 'ko', 'es', 'th'
lang: "en", // 'en', 'zh_CN', 'zh_TW', 'ja', 'ko', 'es', 'th', 'vi'
themeColor: {
hue: 250, // Default hue for the theme color, from 0 to 360. e.g. red: 0, teal: 200, cyan: 250, pink: 345
fixed: false, // Hide the theme color picker for visitors

38
src/i18n/languages/vi.ts Normal file
View File

@@ -0,0 +1,38 @@
import Key from "../i18nKey";
import type { Translation } from "../translation";
export const vi: Translation = {
[Key.home]: "Trang chủ",
[Key.about]: "Giới thiệu",
[Key.archive]: "Kho bài",
[Key.search]: "Tìm kiếm",
[Key.tags]: "Thẻ",
[Key.categories]: "Danh mục",
[Key.recentPosts]: "Bài viết mới nhất",
[Key.comments]: "Bình luận",
[Key.untitled]: "Không tiêu đề",
[Key.uncategorized]: "Chưa phân loại",
[Key.noTags]: "Chưa có thẻ",
[Key.wordCount]: "từ",
[Key.wordsCount]: "từ",
[Key.minuteCount]: "phút đọc",
[Key.minutesCount]: "phút đọc",
[Key.postCount]: "bài viết",
[Key.postsCount]: "bài viết",
[Key.themeColor]: "Màu giao diện",
[Key.lightMode]: "Sáng",
[Key.darkMode]: "Tối",
[Key.systemMode]: "Hệ thống",
[Key.more]: "Thêm",
[Key.author]: "Tác giả",
[Key.publishedAt]: "Đăng vào lúc",
[Key.license]: "Giấy phép bản quyền",
};

View File

@@ -5,6 +5,7 @@ import { es } from "./languages/es";
import { ja } from "./languages/ja";
import { ko } from "./languages/ko";
import { th } from "./languages/th";
import { vi } from "./languages/vi";
import { zh_CN } from "./languages/zh_CN";
import { zh_TW } from "./languages/zh_TW";
@@ -28,6 +29,8 @@ const map: { [key: string]: Translation } = {
ko_kr: ko,
th: th,
th_th: th,
vi: vi,
vi_vn: vi,
};
export function getTranslation(lang: string): Translation {