Skip to content

Commit

Permalink
feat(admin-ui-plugin): Support for defaultLocale
Browse files Browse the repository at this point in the history
Relates to #1196
  • Loading branch information
michaelbromley committed Dec 2, 2021
1 parent b5cdbce commit e7bd576
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/admin-ui-plugin/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ 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 defaultLocale = undefined;

export const defaultAvailableLanguages = [
LanguageCode.de,
Expand Down
9 changes: 8 additions & 1 deletion packages/admin-ui-plugin/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ import express from 'express';
import fs from 'fs-extra';
import path from 'path';

import { defaultAvailableLanguages, defaultLanguage, DEFAULT_APP_PATH, loggerCtx } from './constants';
import {
defaultAvailableLanguages,
defaultLanguage,
defaultLocale,
DEFAULT_APP_PATH,
loggerCtx,
} from './constants';

/**
* @description
Expand Down Expand Up @@ -227,6 +233,7 @@ export class AdminUiPlugin implements NestModule {
authOptions.authTokenHeaderKey || DEFAULT_AUTH_TOKEN_HEADER_KEY,
),
defaultLanguage: propOrDefault('defaultLanguage', defaultLanguage),
defaultLocale: propOrDefault('defaultLocale', defaultLocale),
availableLanguages: propOrDefault('availableLanguages', defaultAvailableLanguages),
loginUrl: AdminUiPlugin.options.adminUiConfig?.loginUrl,
brand: AdminUiPlugin.options.adminUiConfig?.brand,
Expand Down

0 comments on commit e7bd576

Please sign in to comment.