ubefr-8162: fix default language (#6621)

Signed-off-by: Alexey Zinoviev <alexey.zinoviev@xored.com>
This commit is contained in:
Alexey Zinoviev 2024-09-18 15:37:54 +04:00 committed by GitHub
parent 85c285741a
commit b5610a8bd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 8 deletions

View File

@ -102,7 +102,7 @@ import print, { printId } from '@hcengineering/print'
import sign from '@hcengineering/sign' import sign from '@hcengineering/sign'
import analyticsCollector, { analyticsCollectorId } from '@hcengineering/analytics-collector' import analyticsCollector, { analyticsCollectorId } from '@hcengineering/analytics-collector'
import { setDefaultLanguage } from '@hcengineering/theme' import { setDefaultLanguage, initThemeStore } from '@hcengineering/theme'
import { configureNotifications } from './notifications' import { configureNotifications } from './notifications'
import { Config, IPCMainExposed, Branding } from './types' import { Config, IPCMainExposed, Branding } from './types'
@ -316,6 +316,8 @@ export async function configurePlatform (): Promise<void> {
setMetadata(workbench.metadata.DefaultSpace, myBranding.defaultSpace ?? tracker.project.DefaultProject) setMetadata(workbench.metadata.DefaultSpace, myBranding.defaultSpace ?? tracker.project.DefaultProject)
setMetadata(workbench.metadata.DefaultSpecial, myBranding.defaultSpecial ?? 'issues') setMetadata(workbench.metadata.DefaultSpecial, myBranding.defaultSpecial ?? 'issues')
initThemeStore()
addEventListener(workbench.event.NotifyConnection, async (evt) => { addEventListener(workbench.event.NotifyConnection, async (evt) => {
await ipcMain.setFrontCookie( await ipcMain.setFrontCookie(
config.FRONT_URL, config.FRONT_URL,

View File

@ -110,7 +110,7 @@ import { coreId } from '@hcengineering/core'
import presentation, { loadServerConfig, parsePreviewConfig, presentationId } from '@hcengineering/presentation' import presentation, { loadServerConfig, parsePreviewConfig, presentationId } from '@hcengineering/presentation'
import { setMetadata } from '@hcengineering/platform' import { setMetadata } from '@hcengineering/platform'
import { setDefaultLanguage } from '@hcengineering/theme' import { setDefaultLanguage, initThemeStore } from '@hcengineering/theme'
import { preferenceId } from '@hcengineering/preference' import { preferenceId } from '@hcengineering/preference'
import { uiId } from '@hcengineering/ui/src/plugin' import { uiId } from '@hcengineering/ui/src/plugin'
@ -400,4 +400,6 @@ export async function configurePlatform() {
setMetadata(workbench.metadata.DefaultApplication, myBranding.defaultApplication ?? 'tracker') setMetadata(workbench.metadata.DefaultApplication, myBranding.defaultApplication ?? 'tracker')
setMetadata(workbench.metadata.DefaultSpace, myBranding.defaultSpace ?? tracker.project.DefaultProject) setMetadata(workbench.metadata.DefaultSpace, myBranding.defaultSpace ?? tracker.project.DefaultProject)
setMetadata(workbench.metadata.DefaultSpecial, myBranding.defaultSpecial ?? 'issues') setMetadata(workbench.metadata.DefaultSpecial, myBranding.defaultSpecial ?? 'issues')
initThemeStore()
} }

View File

@ -67,10 +67,14 @@ export class ThemeOptions {
readonly language: string readonly language: string
) {} ) {}
} }
export const themeStore = writable<ThemeOptions>( export const themeStore = writable<ThemeOptions>()
export function initThemeStore (): void {
themeStore.set(
new ThemeOptions( new ThemeOptions(
getCurrentFontSize() === 'normal-font' ? 16 : 14, getCurrentFontSize() === 'normal-font' ? 16 : 14,
isThemeDark(getCurrentTheme()), isThemeDark(getCurrentTheme()),
getCurrentLanguage() getCurrentLanguage()
) )
) )
}