[Info] Spelling checking in FireMonkey macOS

In FireMonkey for macOS, the platform offers a spelling checking service, so text components (including TMemo and TRichViewEdit v20.5.1+) can use it.
Unfortunately, the default implementation of this service has several problems that make it almost unusable.
See https://quality.embarcadero.com/browse/RSP-39832

There is a workaround that solves the most important problem. It turns on language auto-detection instead of using two preferred dictionaries.
Add this code to your main form’s unit.

uses
  ...
  FMX.Platform,
  {$IFDEF MACOS}FMX.SpellChecker.Mac,{$ENDIF}
  ...;

{$IFDEF MACOS}
procedure SetMacSpellCheckerLanguageDetection;
var
  Svc: TMacSpellCheckerService;
begin
  TPlatformServices.Current.RemovePlatformService(IFMXSpellCheckerService);
  Svc := TMacSpellCheckerService.Create;
  Svc.MaxUsedPrefferedLanguagesCount := 0; // language auto-detection
  TPlatformServices.Current.AddPlatformService(IFMXSpellCheckerService, Svc);
end;
{$ENDIF}

initialization

  {$IFDEF MACOS}
  SetMacSpellCheckerLanguageDetection;
  {$ENDIF}
Sergey Tkachenko

Share
Published by
Sergey Tkachenko

Recent Posts

ANN: IDEInstaller 2.5

IDEInstaller 2.5 includes support for 64-bit Delphi IDE.

1 week ago

ANN: TRichView 23.2 – Markdown in Clipboard

We have released TRichView 23.2 and updates of related components The main new feature in…

2 weeks ago

ANN: RVMedia 11.1 – error handling and UDP streaming

RVMedia 11.1 has been released Main new features: UDP streaming with FFmpeg improved error handling…

3 weeks ago

TRichView 23.1 – RichViewActions for Lazarus for Linux

We have released TRichView 23.1 and updates of related components The main new feature in…

3 months ago

IDEInstaller v2.4

We've released our installer program as freeware with source code:http://www.trichview.com/ideinstall/ It was updated to version…

4 months ago

TRichView 23 – Lazarus for Linux, equations in files

We have released TRichView 23 and updates of related components This update is free for…

4 months ago