[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

TRichView 24.0.3 – New images for dialogs

RichView 24.0.3 includes a new set of images for dialog boxes of RichViewActions and ScaleRichView…

2 weeks ago

TRichView 24.0.2 – new background dialogs

This update completes the work on the new background definition system (well, almost).The new properties…

3 weeks ago

RVMedia 11.2 – RAD Studio 13 Florence, second remuxing

We are pleased to announce a new release of RVMedia. RVMedia now supports RAD Studio…

2 months ago

TRichView 24 – RAD Studio 13 Florence, chat, background

We are pleased to announce new releases of TRichView, ScaleRichView, and ReportWorkshop. All components now…

2 months ago

ADUG Symposium – May 9th

The next ADUG Symposium will take place on Friday, 9th May. You can attend in…

7 months ago

ANN: IDEInstaller 2.5

IDEInstaller 2.5 includes support for 64-bit Delphi IDE.

8 months ago