Add logging to spellcheck dictionaries loading
This commit is contained in:
parent
15e9bb3d12
commit
a32a345500
2 changed files with 19 additions and 2 deletions
|
@ -797,7 +797,8 @@ async function createWindow() {
|
||||||
setupSpellChecker(
|
setupSpellChecker(
|
||||||
mainWindow,
|
mainWindow,
|
||||||
getPreferredSystemLocales(),
|
getPreferredSystemLocales(),
|
||||||
getResolvedMessagesLocale().i18n
|
getResolvedMessagesLocale().i18n,
|
||||||
|
getLogger()
|
||||||
);
|
);
|
||||||
if (!startInTray && windowConfig && windowConfig.maximized) {
|
if (!startInTray && windowConfig && windowConfig.maximized) {
|
||||||
mainWindow.maximize();
|
mainWindow.maximize();
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { maybeParseUrl } from '../ts/util/url';
|
||||||
import type { MenuListType } from '../ts/types/menu';
|
import type { MenuListType } from '../ts/types/menu';
|
||||||
import type { LocalizerType } from '../ts/types/Util';
|
import type { LocalizerType } from '../ts/types/Util';
|
||||||
import { strictAssert } from '../ts/util/assert';
|
import { strictAssert } from '../ts/util/assert';
|
||||||
|
import type { LoggerType } from '../ts/types/Logging';
|
||||||
|
|
||||||
export const FAKE_DEFAULT_LOCALE = 'en-x-ignore'; // -x- is an extension space for attaching other metadata to the locale
|
export const FAKE_DEFAULT_LOCALE = 'en-x-ignore'; // -x- is an extension space for attaching other metadata to the locale
|
||||||
|
|
||||||
|
@ -55,9 +56,24 @@ export function getLanguages(
|
||||||
export const setup = (
|
export const setup = (
|
||||||
browserWindow: BrowserWindow,
|
browserWindow: BrowserWindow,
|
||||||
preferredSystemLocales: ReadonlyArray<string>,
|
preferredSystemLocales: ReadonlyArray<string>,
|
||||||
i18n: LocalizerType
|
i18n: LocalizerType,
|
||||||
|
logger: LoggerType
|
||||||
): void => {
|
): void => {
|
||||||
const { session } = browserWindow.webContents;
|
const { session } = browserWindow.webContents;
|
||||||
|
|
||||||
|
session.on('spellcheck-dictionary-download-begin', (_event, lang) => {
|
||||||
|
logger.info('spellcheck: dictionary download begin:', lang);
|
||||||
|
});
|
||||||
|
session.on('spellcheck-dictionary-download-failure', (_event, lang) => {
|
||||||
|
logger.error('spellcheck: dictionary download failure:', lang);
|
||||||
|
});
|
||||||
|
session.on('spellcheck-dictionary-download-success', (_event, lang) => {
|
||||||
|
logger.info('spellcheck: dictionary download success:', lang);
|
||||||
|
});
|
||||||
|
session.on('spellcheck-dictionary-initialized', (_event, lang) => {
|
||||||
|
logger.info('spellcheck: dictionary initialized:', lang);
|
||||||
|
});
|
||||||
|
|
||||||
const availableLocales = session.availableSpellCheckerLanguages;
|
const availableLocales = session.availableSpellCheckerLanguages;
|
||||||
const languages = getLanguages(
|
const languages = getLanguages(
|
||||||
preferredSystemLocales,
|
preferredSystemLocales,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue