From c8e809334611a0d3ec6308a4a211be7fc2edb1ee Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 9 Nov 2018 22:02:48 +0900 Subject: [PATCH] Fix bug --- src/server/web/docs.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/web/docs.ts b/src/server/web/docs.ts index 292f3135b..d91813c86 100644 --- a/src/server/web/docs.ts +++ b/src/server/web/docs.ts @@ -16,6 +16,8 @@ import config from '../../config'; import { licenseHtml } from '../../misc/license'; const constants = require('../../const.json'); import endpoints from '../api/endpoints'; +const locales = require('../../../locales'); +const nestedProperty = require('nested-property'); async function genVars(lang: string): Promise<{ [key: string]: any }> { const vars = {} as { [key: string]: any }; @@ -53,8 +55,7 @@ async function genVars(lang: string): Promise<{ [key: string]: any }> { vars['license'] = licenseHtml; - //const i18n = new I18n(lang); - //vars['i18n'] = (key: string) => i18n.get(null, key); + vars['i18n'] = (key: string) => nestedProperty.get(locales[lang], key); return vars; }