From fe01a5a28f34c873019ae3c34086acd6bd791a1d Mon Sep 17 00:00:00 2001 From: おさむのひと <46447427+samunohito@users.noreply.github.com> Date: Sun, 30 Nov 2025 13:27:44 +0900 Subject: refactor: localesをworkspace管理下のパッケージに (#16895) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: localesをworkspace管理下のパッケージに * fix copilot review * move * move * rename * fix ci * revert unwanted indent changes * fix * fix * fix * fix * 間違えてコミットしていたのを戻す * 不要 * 追加漏れ * ymlの場所だけ戻す * localesの位置を戻したのでこの差分は不要 * 内容的にlocalesにある方が正しい * i18nパッケージ用のREADME.mdを用意 * fix locale.yml * fix locale.yml --------- Co-authored-by: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> --- packages/frontend-shared/js/i18n.ts | 2 +- packages/frontend-shared/js/locale.ts | 2 +- packages/frontend-shared/js/store-boot-errors.ts | 2 +- packages/frontend-shared/package.json | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'packages/frontend-shared') diff --git a/packages/frontend-shared/js/i18n.ts b/packages/frontend-shared/js/i18n.ts index 3b103c4714..a42450ee88 100644 --- a/packages/frontend-shared/js/i18n.ts +++ b/packages/frontend-shared/js/i18n.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import type { ILocale, ParameterizedString } from '../../../locales/index.js'; +import type { ILocale, ParameterizedString } from 'i18n'; // eslint-disable-next-line @typescript-eslint/no-explicit-any type TODO = any; diff --git a/packages/frontend-shared/js/locale.ts b/packages/frontend-shared/js/locale.ts index 87e3922fd9..38584fbed6 100644 --- a/packages/frontend-shared/js/locale.ts +++ b/packages/frontend-shared/js/locale.ts @@ -4,7 +4,7 @@ */ import { lang, version } from '@@/js/config.js'; -import type { Locale } from '../../../locales/index.js'; +import type { Locale } from 'i18n'; // ここはビルド時に const locale = JSON.parse("...") みたいな感じで置き換えられるので top-level await は消える export let locale: Locale = await window.fetch(`/assets/locales/${lang}.${version}.json`).then(r => r.json(), () => null); diff --git a/packages/frontend-shared/js/store-boot-errors.ts b/packages/frontend-shared/js/store-boot-errors.ts index 31e6248445..2741339165 100644 --- a/packages/frontend-shared/js/store-boot-errors.ts +++ b/packages/frontend-shared/js/store-boot-errors.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import type { Locale } from '../../../locales/index.js'; +import type { Locale } from 'i18n'; type BootLoaderLocaleBody = Locale['_bootErrors'] & { reload: Locale['reload'] }; diff --git a/packages/frontend-shared/package.json b/packages/frontend-shared/package.json index a407df6bf8..5806414930 100644 --- a/packages/frontend-shared/package.json +++ b/packages/frontend-shared/package.json @@ -34,6 +34,7 @@ "js-built" ], "dependencies": { + "i18n": "workspace:*", "misskey-js": "workspace:*", "vue": "3.5.24" } -- cgit v1.2.3-freya