From 729997e39c3efd879336f85ed4936f01626df5d5 Mon Sep 17 00:00:00 2001 From: Rafal Dziegielewski Date: Mon, 17 Apr 2023 09:13:40 +0200 Subject: [PATCH] fix(beta): fix locale not loading custom translations in Login page --- src/frontend/login-template.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/login-template.tsx b/src/frontend/login-template.tsx index 3b776572a..8b0785fc0 100644 --- a/src/frontend/login-template.tsx +++ b/src/frontend/login-template.tsx @@ -8,7 +8,8 @@ import createStore, { import ViewHelpers from '../backend/utils/view-helpers/view-helpers.js' import { initializeAssets, initializeBranding, initializeLocale } from './store/index.js' import AdminJS from '../adminjs.js' -import { getAssets, getBranding, getFaviconFromBranding } from '../backend/utils/options-parser/options-parser.js' +import { getAssets, getBranding, getFaviconFromBranding, getLocales } from '../backend/utils/options-parser/options-parser.js' +import { defaultLocale } from '../locale/index.js' type LoginTemplateAttributes = { /** @@ -32,6 +33,7 @@ const html = async ( const branding = await getBranding(admin) const assets = await getAssets(admin) const faviconTag = getFaviconFromBranding(branding) + const locales = await getLocales(admin || defaultLocale) const scripts = ((assets && assets.scripts) || []) .map((s) => ``) @@ -40,7 +42,7 @@ const html = async ( store.dispatch(initializeBranding(branding)) store.dispatch(initializeAssets(assets)) - store.dispatch(initializeLocale(admin.locale)) + store.dispatch(initializeLocale(locales)) const theme = combineStyles(branding.theme) const reduxState = store.getState()