summaryrefslogtreecommitdiff
path: root/packages/i18n/src
diff options
context:
space:
mode:
authorかっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>2025-12-01 18:51:36 +0900
committerGitHub <noreply@github.com>2025-12-01 18:51:36 +0900
commit7b9e83a6b873904b6a394ea672d4b3b9f60cd03a (patch)
tree68442b2e475fbd3690fc914e9385cb4fb81befe4 /packages/i18n/src
parentBump version to 2025.11.2-alpha.4 (diff)
downloadmisskey-7b9e83a6b873904b6a394ea672d4b3b9f60cd03a.tar.gz
misskey-7b9e83a6b873904b6a394ea672d4b3b9f60cd03a.tar.bz2
misskey-7b9e83a6b873904b6a394ea672d4b3b9f60cd03a.zip
enhance(backend): バックエンドで言語リストのみを参照するように (#16915)
Diffstat (limited to 'packages/i18n/src')
-rw-r--r--packages/i18n/src/const.ts41
-rw-r--r--packages/i18n/src/index.ts38
2 files changed, 42 insertions, 37 deletions
diff --git a/packages/i18n/src/const.ts b/packages/i18n/src/const.ts
new file mode 100644
index 0000000000..bb690e7542
--- /dev/null
+++ b/packages/i18n/src/const.ts
@@ -0,0 +1,41 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and misskey-project
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+export const languages = [
+ 'ar-SA',
+ 'ca-ES',
+ 'cs-CZ',
+ 'da-DK',
+ 'de-DE',
+ 'en-US',
+ 'es-ES',
+ 'fr-FR',
+ 'id-ID',
+ 'it-IT',
+ 'ja-JP',
+ 'ja-KS',
+ 'kab-KAB',
+ 'kn-IN',
+ 'ko-KR',
+ 'nl-NL',
+ 'no-NO',
+ 'pl-PL',
+ 'pt-PT',
+ 'ru-RU',
+ 'sk-SK',
+ 'th-TH',
+ 'tr-TR',
+ 'ug-CN',
+ 'uk-UA',
+ 'vi-VN',
+ 'zh-CN',
+ 'zh-TW',
+] as const;
+
+export const primaries = {
+ 'en': 'US',
+ 'ja': 'JP',
+ 'zh': 'CN',
+} as const satisfies Record<string, string>;
diff --git a/packages/i18n/src/index.ts b/packages/i18n/src/index.ts
index 77a4f42012..21d215159f 100644
--- a/packages/i18n/src/index.ts
+++ b/packages/i18n/src/index.ts
@@ -9,48 +9,12 @@
import * as fs from 'node:fs';
import * as yaml from 'js-yaml';
+import { languages, primaries } from './const.js';
import type { Locale } from './autogen/locale.js';
import type { ILocale, ParameterizedString } from './types.js';
-const languages = [
- 'ar-SA',
- 'ca-ES',
- 'cs-CZ',
- 'da-DK',
- 'de-DE',
- 'en-US',
- 'es-ES',
- 'fr-FR',
- 'id-ID',
- 'it-IT',
- 'ja-JP',
- 'ja-KS',
- 'kab-KAB',
- 'kn-IN',
- 'ko-KR',
- 'nl-NL',
- 'no-NO',
- 'pl-PL',
- 'pt-PT',
- 'ru-RU',
- 'sk-SK',
- 'th-TH',
- 'tr-TR',
- 'ug-CN',
- 'uk-UA',
- 'vi-VN',
- 'zh-CN',
- 'zh-TW',
-] as const;
-
type Language = typeof languages[number];
-const primaries = {
- 'en': 'US',
- 'ja': 'JP',
- 'zh': 'CN',
-} as const satisfies Record<string, string>;
-
type PrimaryLang = keyof typeof primaries;
type Locales = Record<Language, ILocale>;