mirror of
https://github.com/element-hq/element-web
synced 2024-11-29 04:48:50 +03:00
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 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) {
|
||||
if (this.notificationCount === count) return;
|
||||
super.setNotificationCount(count);
|
||||
|
@ -488,13 +498,21 @@ export default class ElectronPlatform extends VectorBasePlatform {
|
|||
return this.eventIndexManager;
|
||||
}
|
||||
|
||||
setLanguage(preferredLangs: string[]) {
|
||||
this._ipcCall('setLanguage', preferredLangs).catch(error => {
|
||||
console.log("Failed to send setLanguage IPC to Electron");
|
||||
setSpellCheckLanguages(preferredLangs: string[]) {
|
||||
this._ipcCall('setSpellCheckLanguages', preferredLangs).catch(error => {
|
||||
console.log("Failed to send setSpellCheckLanguages IPC to Electron");
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
|
||||
async getSpellCheckLanguages(): Promise<string[]> {
|
||||
return this._ipcCall('getSpellCheckLanguages');
|
||||
}
|
||||
|
||||
async getAvailableSpellCheckLanguages(): Promise<string[]> {
|
||||
return this._ipcCall('getAvailableSpellCheckLanguages');
|
||||
}
|
||||
|
||||
getSSOCallbackUrl(fragmentAfterLogin: string): URL {
|
||||
const url = super.getSSOCallbackUrl(fragmentAfterLogin);
|
||||
url.protocol = "element";
|
||||
|
|
Loading…
Reference in a new issue