Add logging to spellcheck dictionaries loading
This commit is contained in:
parent
15e9bb3d12
commit
a32a345500
|
@ -797,7 +797,8 @@ async function createWindow() {
|
|||
setupSpellChecker(
|
||||
mainWindow,
|
||||
getPreferredSystemLocales(),
|
||||
getResolvedMessagesLocale().i18n
|
||||
getResolvedMessagesLocale().i18n,
|
||||
getLogger()
|
||||
);
|
||||
if (!startInTray && windowConfig && windowConfig.maximized) {
|
||||
mainWindow.maximize();
|
||||
|
|
|
@ -11,6 +11,7 @@ import { maybeParseUrl } from '../ts/util/url';
|
|||
import type { MenuListType } from '../ts/types/menu';
|
||||
import type { LocalizerType } from '../ts/types/Util';
|
||||
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
|
||||
|
||||
|
@ -55,9 +56,24 @@ export function getLanguages(
|
|||
export const setup = (
|
||||
browserWindow: BrowserWindow,
|
||||
preferredSystemLocales: ReadonlyArray<string>,
|
||||
i18n: LocalizerType
|
||||
i18n: LocalizerType,
|
||||
logger: LoggerType
|
||||
): void => {
|
||||
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 languages = getLanguages(
|
||||
preferredSystemLocales,
|
||||
|
|
Loading…
Reference in New Issue
Block a user