diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index b94fea1da..c3a9848b7 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1079,6 +1079,8 @@ admin/views/instance.vue: instance-name: "インスタンス名" instance-description: "インスタンスの紹介" banner-url: "バナー画像URL" + languages: "インスタンスの対象言語" + languages-desc: "スペースで区切って複数設定できます。" maintainer-config: "管理者情報" maintainer-name: "管理者名" maintainer-email: "管理者の連絡先" diff --git a/src/client/app/admin/views/instance.vue b/src/client/app/admin/views/instance.vue index 9d0204cfb..815cea631 100644 --- a/src/client/app/admin/views/instance.vue +++ b/src/client/app/admin/views/instance.vue @@ -6,6 +6,7 @@ %i18n:@instance-name% %i18n:@instance-description% %i18n:@banner-url% + %i18n:@languages%%i18n:@languages-desc%
%i18n:@maintainer-config%
@@ -31,7 +32,7 @@
%i18n:@proxy-account-config%
%i18n:@proxy-account-info% - @%i18n:@proxy-account-username%%i18n:@proxy-account-username-desc% + @%i18n:@proxy-account-username%%i18n:@proxy-account-username-desc% %i18n:@proxy-account-warn%
@@ -68,6 +69,7 @@ export default Vue.extend({ bannerUrl: null, name: null, description: null, + languages: null, cacheRemoteFiles: false, localDriveCapacityMb: null, remoteDriveCapacityMb: null, @@ -87,6 +89,7 @@ export default Vue.extend({ this.bannerUrl = meta.bannerUrl; this.name = meta.name; this.description = meta.description; + this.languages = meta.langs.join(' '); this.cacheRemoteFiles = meta.cacheRemoteFiles; this.localDriveCapacityMb = meta.driveCapacityPerLocalUserMb; this.remoteDriveCapacityMb = meta.driveCapacityPerRemoteUserMb; @@ -119,6 +122,7 @@ export default Vue.extend({ bannerUrl: this.bannerUrl, name: this.name, description: this.description, + langs: this.languages.split(' '), cacheRemoteFiles: this.cacheRemoteFiles, localDriveCapacityMb: parseInt(this.localDriveCapacityMb, 10), remoteDriveCapacityMb: parseInt(this.remoteDriveCapacityMb, 10), diff --git a/src/misc/fetch-meta.ts b/src/misc/fetch-meta.ts index fde244d1c..e8ff1aca7 100644 --- a/src/misc/fetch-meta.ts +++ b/src/misc/fetch-meta.ts @@ -2,6 +2,7 @@ import Meta, { IMeta } from '../models/meta'; const defaultMeta: any = { name: 'Misskey', + langs: [], cacheRemoteFiles: true, localDriveCapacityMb: 256, remoteDriveCapacityMb: 8, diff --git a/src/models/meta.ts b/src/models/meta.ts index 8d3a917df..f62117a0b 100644 --- a/src/models/meta.ts +++ b/src/models/meta.ts @@ -119,6 +119,8 @@ export type IMeta = { email?: string; }; + langs?: string[]; + broadcasts?: any[]; stats?: { diff --git a/src/server/api/endpoints/admin/update-meta.ts b/src/server/api/endpoints/admin/update-meta.ts index bcfa420ed..d45a8759f 100644 --- a/src/server/api/endpoints/admin/update-meta.ts +++ b/src/server/api/endpoints/admin/update-meta.ts @@ -130,6 +130,13 @@ export const meta = { desc: { 'ja-JP': 'インスタンス管理者の連絡先メールアドレス' } + }, + + langs: { + validator: $.arr($.str).optional, + desc: { + 'ja-JP': 'インスタンスの対象言語' + } } } }; @@ -205,6 +212,10 @@ export default define(meta, (ps) => new Promise(async (res, rej) => { set['maintainer.email'] = ps.maintainerEmail; } + if (ps.langs !== undefined) { + set.langs = ps.langs; + } + await Meta.update({}, { $set: set }, { upsert: true }); diff --git a/src/server/api/endpoints/meta.ts b/src/server/api/endpoints/meta.ts index 311e3d669..625a9519d 100644 --- a/src/server/api/endpoints/meta.ts +++ b/src/server/api/endpoints/meta.ts @@ -43,6 +43,7 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => { name: instance.name, description: instance.description, + langs: instance.langs, secure: config.https != null, machine: os.hostname(),