From 7348f0b20541f408e21ea9aef48b13a92025bc53 Mon Sep 17 00:00:00 2001 From: TAEINJEONG Date: Wed, 20 Aug 2025 17:36:25 +0900 Subject: [PATCH 1/2] =?UTF-8?q?test:=20=EB=94=94=EB=B2=84=EA=B9=85=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/test.ts | 17 +++++++++++++++++ src/pages/main.tsx | 3 +++ 2 files changed, 20 insertions(+) create mode 100644 src/lib/test.ts diff --git a/src/lib/test.ts b/src/lib/test.ts new file mode 100644 index 0000000..ae723d7 --- /dev/null +++ b/src/lib/test.ts @@ -0,0 +1,17 @@ +import fs from 'node:fs/promises'; +import path from 'node:path'; + +export async function i18nHealthCheck(locale = 'ko', nss = ['main', 'comment', 'emotion']) { + const result: Record = {}; + for (const ns of nss) { + const p = path.join(process.cwd(), 'public', 'locales', locale, `${ns}.json`); + try { + const raw = await fs.readFile(p, 'utf8'); + const json = JSON.parse(raw); + result[`${locale}/${ns}`] = { exists: true, size: Object.keys(json ?? {}).length }; + } catch { + result[`${locale}/${ns}`] = { exists: false, size: 0 }; + } + } + return result; +} diff --git a/src/pages/main.tsx b/src/pages/main.tsx index 9b764b3..dda73db 100644 --- a/src/pages/main.tsx +++ b/src/pages/main.tsx @@ -23,6 +23,8 @@ import { dehydrate, QueryClient } from '@tanstack/react-query'; import { listEpigrams } from '@/services/epigrams'; import { listComments } from '@/services/comments'; +import { i18nHealthCheck } from '@/lib/test.js'; + export const getStaticProps: GetStaticProps = async ({ locale }) => { const qc = new QueryClient(); @@ -88,6 +90,7 @@ const Main = () => { return (
+
{JSON.stringify(i18nDiag, null, 2)}

{t('today')}

From 99ffdece7f147a298665052dcf85fae3b3b83f75 Mon Sep 17 00:00:00 2001 From: TAEINJEONG Date: Wed, 20 Aug 2025 17:41:16 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EC=9B=90=EC=83=81=20=EB=B3=B5?= =?UTF-8?q?=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/test.ts | 17 ----------------- src/pages/main.tsx | 3 --- 2 files changed, 20 deletions(-) delete mode 100644 src/lib/test.ts diff --git a/src/lib/test.ts b/src/lib/test.ts deleted file mode 100644 index ae723d7..0000000 --- a/src/lib/test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import fs from 'node:fs/promises'; -import path from 'node:path'; - -export async function i18nHealthCheck(locale = 'ko', nss = ['main', 'comment', 'emotion']) { - const result: Record = {}; - for (const ns of nss) { - const p = path.join(process.cwd(), 'public', 'locales', locale, `${ns}.json`); - try { - const raw = await fs.readFile(p, 'utf8'); - const json = JSON.parse(raw); - result[`${locale}/${ns}`] = { exists: true, size: Object.keys(json ?? {}).length }; - } catch { - result[`${locale}/${ns}`] = { exists: false, size: 0 }; - } - } - return result; -} diff --git a/src/pages/main.tsx b/src/pages/main.tsx index dda73db..9b764b3 100644 --- a/src/pages/main.tsx +++ b/src/pages/main.tsx @@ -23,8 +23,6 @@ import { dehydrate, QueryClient } from '@tanstack/react-query'; import { listEpigrams } from '@/services/epigrams'; import { listComments } from '@/services/comments'; -import { i18nHealthCheck } from '@/lib/test.js'; - export const getStaticProps: GetStaticProps = async ({ locale }) => { const qc = new QueryClient(); @@ -90,7 +88,6 @@ const Main = () => { return (
-
{JSON.stringify(i18nDiag, null, 2)}

{t('today')}