From cfcccbda62ee6756c6b81816719d5bc0c7269c83 Mon Sep 17 00:00:00 2001 From: Kevin Deng Date: Thu, 20 Aug 2026 04:33:40 +0900 Subject: [PATCH] Add Japanese localization support (#11) --- app/components/DataSources.vue | 8 +- app/generated/face-marks.ts | 6 +- app/locales/all.ts | 2 + app/locales/index.ts | 20 ++-- app/locales/ja-jp.ts | 161 +++++++++++++++++++++++++++++++++ app/styles/vars.css | 12 +++ public/data/sources.json | 42 +++++++-- scripts/build-fonts.ts | 14 ++- scripts/sources.ts | 35 ++++++- scripts/tests/i18n.test.ts | 45 +++++++++ 10 files changed, 321 insertions(+), 24 deletions(-) create mode 100644 app/locales/ja-jp.ts create mode 100644 scripts/tests/i18n.test.ts diff --git a/app/components/DataSources.vue b/app/components/DataSources.vue index b51b211..797a278 100644 --- a/app/components/DataSources.vue +++ b/app/components/DataSources.vue @@ -6,6 +6,10 @@ withDefaults(defineProps<{ detailed?: boolean }>(), { detailed: false }) const { t, locale } = useT() const list = sources as Source[] +const localize = ( + fallback: string, + translations?: Source['localizedName'], +): string => translations?.[locale.value] ?? fallback