diff --git a/src/i18n/i18nKey.ts b/src/i18n/i18nKey.ts index f796b17..33b18cf 100644 --- a/src/i18n/i18nKey.ts +++ b/src/i18n/i18nKey.ts @@ -32,6 +32,10 @@ enum I18nKey { author = "author", publishedAt = "publishedAt", license = "license", + + notFound = "notFound", + notFoundDesc = "notFoundDesc", + backToHome = "backToHome", } export default I18nKey; diff --git a/src/i18n/languages/en.ts b/src/i18n/languages/en.ts index 5ecad05..a039cbc 100644 --- a/src/i18n/languages/en.ts +++ b/src/i18n/languages/en.ts @@ -35,4 +35,8 @@ export const en: Translation = { [Key.author]: "Author", [Key.publishedAt]: "Published at", [Key.license]: "License", + + [Key.notFound]: "Page Not Found", + [Key.notFoundDesc]: "The link is broken, the page has gone missing", + [Key.backToHome]: "Back to Home", }; diff --git a/src/i18n/languages/es.ts b/src/i18n/languages/es.ts deleted file mode 100644 index 9e4d9c9..0000000 --- a/src/i18n/languages/es.ts +++ /dev/null @@ -1,38 +0,0 @@ -import Key from "../i18nKey"; -import type { Translation } from "../translation"; - -export const es: Translation = { - [Key.home]: "Inicio", - [Key.about]: "Sobre mí", - [Key.archive]: "Archivo", - [Key.search]: "Buscar", - - [Key.tags]: "Etiquetas", - [Key.categories]: "Categorías", - [Key.recentPosts]: "Publicaciones recientes", - - [Key.comments]: "Comentarios", - - [Key.untitled]: "Sin título", - [Key.uncategorized]: "Sin categoría", - [Key.noTags]: "Sin etiquetas", - - [Key.wordCount]: "palabra", - [Key.wordsCount]: "palabras", - [Key.minuteCount]: "minuto", - [Key.minutesCount]: "minutos", - [Key.postCount]: "publicación", - [Key.postsCount]: "publicaciones", - - [Key.themeColor]: "Color del tema", - - [Key.lightMode]: "Claro", - [Key.darkMode]: "Oscuro", - [Key.systemMode]: "Sistema", - - [Key.more]: "Más", - - [Key.author]: "Autor", - [Key.publishedAt]: "Publicado el", - [Key.license]: "Licencia", -}; diff --git a/src/i18n/languages/id.ts b/src/i18n/languages/id.ts deleted file mode 100644 index 9143ed5..0000000 --- a/src/i18n/languages/id.ts +++ /dev/null @@ -1,38 +0,0 @@ -import Key from "../i18nKey"; -import type { Translation } from "../translation"; - -export const id: Translation = { - [Key.home]: "Beranda", - [Key.about]: "Tentang", - [Key.archive]: "Arsip", - [Key.search]: "Cari", - - [Key.tags]: "Tag", - [Key.categories]: "Kategori", - [Key.recentPosts]: "Postingan Terbaru", - - [Key.comments]: "Komentar", - - [Key.untitled]: "Tanpa Judul", - [Key.uncategorized]: "Tanpa Kategori", - [Key.noTags]: "Tanpa Tag", - - [Key.wordCount]: "kata", - [Key.wordsCount]: "kata", - [Key.minuteCount]: "menit", - [Key.minutesCount]: "menit", - [Key.postCount]: "postingan", - [Key.postsCount]: "postingan", - - [Key.themeColor]: "Warna Tema", - - [Key.lightMode]: "Terang", - [Key.darkMode]: "Gelap", - [Key.systemMode]: "Sistem", - - [Key.more]: "Lainnya", - - [Key.author]: "Penulis", - [Key.publishedAt]: "Diterbitkan pada", - [Key.license]: "Lisensi", -}; diff --git a/src/i18n/languages/ja.ts b/src/i18n/languages/ja.ts deleted file mode 100644 index 97b4579..0000000 --- a/src/i18n/languages/ja.ts +++ /dev/null @@ -1,38 +0,0 @@ -import Key from "../i18nKey"; -import type { Translation } from "../translation"; - -export const ja: Translation = { - [Key.home]: "Home", - [Key.about]: "About", - [Key.archive]: "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]: "ライセンス", -}; diff --git a/src/i18n/languages/ko.ts b/src/i18n/languages/ko.ts deleted file mode 100644 index 9936ebf..0000000 --- a/src/i18n/languages/ko.ts +++ /dev/null @@ -1,38 +0,0 @@ -import Key from "../i18nKey"; -import type { Translation } from "../translation"; - -export const ko: 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]: "라이선스", -}; diff --git a/src/i18n/languages/th.ts b/src/i18n/languages/th.ts deleted file mode 100644 index 67c9ad9..0000000 --- a/src/i18n/languages/th.ts +++ /dev/null @@ -1,38 +0,0 @@ -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]: "สัญญาอนุญาต", -}; diff --git a/src/i18n/languages/tr.ts b/src/i18n/languages/tr.ts deleted file mode 100644 index dfd1d9c..0000000 --- a/src/i18n/languages/tr.ts +++ /dev/null @@ -1,38 +0,0 @@ -import Key from "../i18nKey"; -import type { Translation } from "../translation"; - -export const tr: Translation = { - [Key.home]: "Anasayfa", - [Key.about]: "Hakkında", - [Key.archive]: "Arşiv", - [Key.search]: "Ara", - - [Key.tags]: "Taglar", - [Key.categories]: "Katagoriler", - [Key.recentPosts]: "Son Paylaşımlar", - - [Key.comments]: "Yorumlar", - - [Key.untitled]: "Başlıksız", - [Key.uncategorized]: "Katagorisiz", - [Key.noTags]: "Tag Bulunamadı", - - [Key.wordCount]: "kelime", - [Key.wordsCount]: "kelime", - [Key.minuteCount]: "dakika", - [Key.minutesCount]: "dakika", - [Key.postCount]: "gönderi", - [Key.postsCount]: "gönderiler", - - [Key.themeColor]: "Tema Rengi", - - [Key.lightMode]: "Aydınlık", - [Key.darkMode]: "Koyu", - [Key.systemMode]: "Sistem", - - [Key.more]: "Daha Fazla", - - [Key.author]: "Yazar", - [Key.publishedAt]: "Yayınlanma:", - [Key.license]: "Lisans", -}; diff --git a/src/i18n/languages/vi.ts b/src/i18n/languages/vi.ts deleted file mode 100644 index 33c36a0..0000000 --- a/src/i18n/languages/vi.ts +++ /dev/null @@ -1,38 +0,0 @@ -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", -}; diff --git a/src/i18n/languages/zh_CN.ts b/src/i18n/languages/zh_CN.ts index d1b8cf1..c493e41 100644 --- a/src/i18n/languages/zh_CN.ts +++ b/src/i18n/languages/zh_CN.ts @@ -35,4 +35,8 @@ export const zh_CN: Translation = { [Key.author]: "作者", [Key.publishedAt]: "发布于", [Key.license]: "许可协议", + + [Key.notFound]: "页面未找到", + [Key.notFoundDesc]: "你访问的链接已断开,页面走丢了", + [Key.backToHome]: "返回首页", }; diff --git a/src/i18n/languages/zh_TW.ts b/src/i18n/languages/zh_TW.ts index 3fca76b..5d25224 100644 --- a/src/i18n/languages/zh_TW.ts +++ b/src/i18n/languages/zh_TW.ts @@ -35,4 +35,8 @@ export const zh_TW: Translation = { [Key.author]: "作者", [Key.publishedAt]: "發佈於", [Key.license]: "許可協議", + + [Key.notFound]: "頁面未找到", + [Key.notFoundDesc]: "你訪問的連結已斷開,頁面走丟了", + [Key.backToHome]: "返回首頁", }; diff --git a/src/i18n/translation.ts b/src/i18n/translation.ts index 69ff5a2..d9ae64c 100644 --- a/src/i18n/translation.ts +++ b/src/i18n/translation.ts @@ -1,13 +1,6 @@ import { siteConfig } from "../config"; import type I18nKey from "./i18nKey"; import { en } from "./languages/en"; -import { es } from "./languages/es"; -import { id } from "./languages/id"; -import { ja } from "./languages/ja"; -import { ko } from "./languages/ko"; -import { th } from "./languages/th"; -import { tr } from "./languages/tr"; -import { vi } from "./languages/vi"; import { zh_CN } from "./languages/zh_CN"; import { zh_TW } from "./languages/zh_TW"; @@ -18,24 +11,12 @@ export type Translation = { const defaultTranslation = en; const map: { [key: string]: Translation } = { - es: es, en: en, en_us: en, en_gb: en, en_au: en, zh_cn: zh_CN, zh_tw: zh_TW, - ja: ja, - ja_jp: ja, - ko: ko, - ko_kr: ko, - th: th, - th_th: th, - vi: vi, - vi_vn: vi, - id: id, - tr: tr, - tr_tr: tr, }; export function getTranslation(lang: string): Translation { diff --git a/src/pages/404.astro b/src/pages/404.astro new file mode 100644 index 0000000..535edba --- /dev/null +++ b/src/pages/404.astro @@ -0,0 +1,54 @@ +--- +import { Icon } from "astro-icon/components"; +import I18nKey from "../i18n/i18nKey"; +import { i18n } from "../i18n/translation"; +import MainGridLayout from "../layouts/MainGridLayout.astro"; +import { url } from "../utils/url-utils"; +--- + + + + + + + {i18n(I18nKey.notFound)} + + + + + + + + + + 404 + + + + + {i18n(I18nKey.notFoundDesc)} + + + + {i18n(I18nKey.backToHome)} + + + + + + + \ No newline at end of file
+ {i18n(I18nKey.notFoundDesc)} +