Merge pull request #15851 from SimonBrandner/feature-multi-language-spell-check
Add multi language spell check
This commit is contained in:
commit
4f0fccfe96
1 changed files with 21 additions and 3 deletions
|
@ -323,6 +323,16 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||||
return 'Electron Platform'; // no translation required: only used for analytics
|
return 'Electron Platform'; // no translation required: only used for analytics
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if platform supports multi-language
|
||||||
|
* spell-checking, otherwise false.
|
||||||
|
*/
|
||||||
|
supportsMultiLanguageSpellCheck(): boolean {
|
||||||
|
// Electron uses OS spell checking on macOS, so no need for in-app options
|
||||||
|
if (isMac) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
setNotificationCount(count: number) {
|
setNotificationCount(count: number) {
|
||||||
if (this.notificationCount === count) return;
|
if (this.notificationCount === count) return;
|
||||||
super.setNotificationCount(count);
|
super.setNotificationCount(count);
|
||||||
|
@ -488,13 +498,21 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
||||||
return this.eventIndexManager;
|
return this.eventIndexManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
setLanguage(preferredLangs: string[]) {
|
setSpellCheckLanguages(preferredLangs: string[]) {
|
||||||
this._ipcCall('setLanguage', preferredLangs).catch(error => {
|
this._ipcCall('setSpellCheckLanguages', preferredLangs).catch(error => {
|
||||||
console.log("Failed to send setLanguage IPC to Electron");
|
console.log("Failed to send setSpellCheckLanguages IPC to Electron");
|
||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getSpellCheckLanguages(): Promise<string[]> {
|
||||||
|
return this._ipcCall('getSpellCheckLanguages');
|
||||||
|
}
|
||||||
|
|
||||||
|
async getAvailableSpellCheckLanguages(): Promise<string[]> {
|
||||||
|
return this._ipcCall('getAvailableSpellCheckLanguages');
|
||||||
|
}
|
||||||
|
|
||||||
getSSOCallbackUrl(fragmentAfterLogin: string): URL {
|
getSSOCallbackUrl(fragmentAfterLogin: string): URL {
|
||||||
const url = super.getSSOCallbackUrl(fragmentAfterLogin);
|
const url = super.getSSOCallbackUrl(fragmentAfterLogin);
|
||||||
url.protocol = "element";
|
url.protocol = "element";
|
||||||
|
|
Loading…
Reference in a new issue