From 46ff9321831af856cbdab5092b75080d21d6bf7d Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Tue, 24 Mar 2020 10:25:26 +0100 Subject: [PATCH] fix(admin-ui-plugin): Add Chinese to the default available languages --- packages/admin-ui-plugin/src/constants.ts | 3 +++ packages/admin-ui-plugin/src/plugin.ts | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/admin-ui-plugin/src/constants.ts b/packages/admin-ui-plugin/src/constants.ts index 20f86b345f..c06f3d1f81 100644 --- a/packages/admin-ui-plugin/src/constants.ts +++ b/packages/admin-ui-plugin/src/constants.ts @@ -1,4 +1,7 @@ +import { LanguageCode } from '@vendure/core'; import path from 'path'; export const DEFAULT_APP_PATH = path.join(__dirname, '../admin-ui'); export const loggerCtx = 'AdminUiPlugin'; +export const defaultLanguage = LanguageCode.en; +export const defaultAvailableLanguages = [LanguageCode.en, LanguageCode.es, LanguageCode.zh]; diff --git a/packages/admin-ui-plugin/src/plugin.ts b/packages/admin-ui-plugin/src/plugin.ts index cbbd3f0ae5..40ca627397 100644 --- a/packages/admin-ui-plugin/src/plugin.ts +++ b/packages/admin-ui-plugin/src/plugin.ts @@ -21,7 +21,7 @@ import fs from 'fs-extra'; import { Server } from 'http'; import path from 'path'; -import { DEFAULT_APP_PATH, loggerCtx } from './constants'; +import { DEFAULT_APP_PATH, defaultAvailableLanguages, defaultLanguage, loggerCtx } from './constants'; /** * @description @@ -252,8 +252,8 @@ export class AdminUiPlugin implements OnVendureBootstrap, OnVendureClose { 'authTokenHeaderKey', authOptions.authTokenHeaderKey || DEFAULT_AUTH_TOKEN_HEADER_KEY, ), - defaultLanguage: propOrDefault('defaultLanguage', LanguageCode.en), - availableLanguages: propOrDefault('availableLanguages', [LanguageCode.en, LanguageCode.es]), + defaultLanguage: propOrDefault('defaultLanguage', defaultLanguage), + availableLanguages: propOrDefault('availableLanguages', defaultAvailableLanguages), }; }