Fix timestamps/spellcheck to use locale override
This commit is contained in:
parent
59fa75c309
commit
fd8691b871
11 changed files with 45 additions and 11 deletions
|
@ -56,6 +56,7 @@ export function getLanguages(
|
|||
export const setup = (
|
||||
browserWindow: BrowserWindow,
|
||||
preferredSystemLocales: ReadonlyArray<string>,
|
||||
localeOverride: string | null,
|
||||
i18n: LocalizerType,
|
||||
logger: LoggerType
|
||||
): void => {
|
||||
|
@ -74,13 +75,16 @@ export const setup = (
|
|||
logger.info('spellcheck: dictionary initialized:', lang);
|
||||
});
|
||||
|
||||
// Locale override should be combined with other preferences rather than
|
||||
// replace them entirely.
|
||||
const combinedLocales =
|
||||
localeOverride != null
|
||||
? [localeOverride, ...preferredSystemLocales]
|
||||
: preferredSystemLocales;
|
||||
|
||||
const availableLocales = session.availableSpellCheckerLanguages;
|
||||
const languages = getLanguages(
|
||||
preferredSystemLocales,
|
||||
availableLocales,
|
||||
'en'
|
||||
);
|
||||
console.log('spellcheck: user locales:', preferredSystemLocales);
|
||||
const languages = getLanguages(combinedLocales, availableLocales, 'en');
|
||||
console.log('spellcheck: user locales:', combinedLocales);
|
||||
console.log(
|
||||
'spellcheck: available spellchecker languages:',
|
||||
availableLocales
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue