mirror of
https://github.com/saicaca/fuwari.git
synced 2026-01-11 23:02:53 +01:00
feat: add Thai translation (#264)
* Create th.ts Created i18n Thai translation file. * Update translation.ts Added Thai language support. * Update config.ts Added Spanish (es) and Thai (th) to commented possible values for `lang` key. * Create README.th.md Created Thai version of README. * Update README.md Added navigation/link to Thai version of README.
This commit is contained in:
@@ -9,7 +9,7 @@ import { LinkPreset } from './types/config'
|
||||
export const siteConfig: SiteConfig = {
|
||||
title: 'Fuwari',
|
||||
subtitle: 'Demo Site',
|
||||
lang: 'en', // 'en', 'zh_CN', 'zh_TW', 'ja', 'ko'
|
||||
lang: 'en', // 'en', 'zh_CN', 'zh_TW', 'ja', 'ko', 'es', 'th'
|
||||
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/th.ts
Normal file
38
src/i18n/languages/th.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import Key from '../i18nKey'
|
||||
import type { Translation } from '../translation'
|
||||
|
||||
export const th: Translation = {
|
||||
[Key.home]: 'หน้าแรก',
|
||||
[Key.about]: 'เกี่ยวกับ',
|
||||
[Key.archive]: 'คลัง',
|
||||
[Key.search]: 'ค้นหา',
|
||||
|
||||
[Key.tags]: 'ป้ายกำกับ',
|
||||
[Key.categories]: 'หมวดหมู่',
|
||||
[Key.recentPosts]: 'โพสต์ล่าสุด',
|
||||
|
||||
[Key.comments]: 'ความคิดเห็น',
|
||||
|
||||
[Key.untitled]: 'ไม่ได้ตั้งชื่อ',
|
||||
[Key.uncategorized]: 'ไม่ได้จัดหมวดหมู่',
|
||||
[Key.noTags]: 'ไม่มีป้ายกำกับ',
|
||||
|
||||
[Key.wordCount]: 'คำ',
|
||||
[Key.wordsCount]: 'คำ',
|
||||
[Key.minuteCount]: 'นาที',
|
||||
[Key.minutesCount]: 'นาที',
|
||||
[Key.postCount]: 'โพสต์',
|
||||
[Key.postsCount]: 'โพสต์',
|
||||
|
||||
[Key.themeColor]: 'สีของธีม',
|
||||
|
||||
[Key.lightMode]: 'สว่าง',
|
||||
[Key.darkMode]: 'มืด',
|
||||
[Key.systemMode]: 'ตามระบบ',
|
||||
|
||||
[Key.more]: 'ดูเพิ่ม',
|
||||
|
||||
[Key.author]: 'ผู้เขียน',
|
||||
[Key.publishedAt]: 'เผยแพร่เมื่อ',
|
||||
[Key.license]: 'สัญญาอนุญาต',
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { en } from './languages/en'
|
||||
import { es } from './languages/es'
|
||||
import { ja } from './languages/ja'
|
||||
import { ko } from './languages/ko'
|
||||
import { th } from './languages/th'
|
||||
import { zh_CN } from './languages/zh_CN'
|
||||
import { zh_TW } from './languages/zh_TW'
|
||||
|
||||
@@ -25,6 +26,8 @@ const map: { [key: string]: Translation } = {
|
||||
ja_jp: ja,
|
||||
ko: ko,
|
||||
ko_kr: ko,
|
||||
th: th,
|
||||
th_th: th,
|
||||
}
|
||||
|
||||
export function getTranslation(lang: string): Translation {
|
||||
@@ -34,4 +37,4 @@ export function getTranslation(lang: string): Translation {
|
||||
export function i18n(key: I18nKey): string {
|
||||
const lang = siteConfig.lang || 'en'
|
||||
return getTranslation(lang)[key]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user