spiegel-keyman/common/windows/delphi/tools/devtools/devtools.dpr
Marc Durdin ad9ab53c72 feat(windows): improve startup time by caching locale names
This was flagged years ago as a potential performance hotspot: each
locale is loaded at process start for any kmcomapi-involved process,
which takes quite a long time. This refactor moves the locale
enumeration out of kmcomapi and into the build process, so we have a
static list of locales put into locale/index.xml.

This includes a minor breaking change to Keyman Engine API on Windows:
`MessageFromID(id, locale)` now only allows the three ids
SKUILanguageName, SKUILanguageNameWithEnglish, and SKLanguageCode, for
performance reasons. At this point, only SKUILanguageNameWithEnglish is
actually used anywhere in Keyman, and it is unlikely that any other
consumers are requesting alternate IDs.

Fixes: #14787
Build-bot: skip release:windows
2025-09-19 14:11:37 +02:00

37 lines
1.3 KiB
ObjectPascal

program devtools;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils,
DevIncludePaths in 'DevIncludePaths.pas',
DevInstallPackages in 'DevInstallPackages.pas',
DevUtils in 'DevUtils.pas',
DevReleaseBuildCheck in 'DevReleaseBuildCheck.pas',
DevCheckGitStatus in 'DevCheckGitStatus.pas',
RegistryKeys in '..\..\general\RegistryKeys.pas',
KeymanVersion in '..\..\general\KeymanVersion.pas',
utilsystem in '..\..\general\utilsystem.pas',
utilexecute in '..\..\general\utilexecute.pas',
Unicode in '..\..\general\Unicode.pas',
GetOsVersion in '..\..\general\GetOsVersion.pas',
SourceRootPath in 'SourceRootPath.pas',
Keyman.System.DevTools.BuildMessageConstants in 'Keyman.System.DevTools.BuildMessageConstants.pas',
Keyman.System.DevTools.BuildSetupStringTranslations in 'Keyman.System.DevTools.BuildSetupStringTranslations.pas',
SetupStrings in '..\..\..\..\..\windows\src\desktop\setup\SetupStrings.pas',
Keyman.System.AndroidStringToKeymanLocaleString in '..\..\general\Keyman.System.AndroidStringToKeymanLocaleString.pas',
Keyman.System.DevTools.BuildLocaleIndex in 'Keyman.System.DevTools.BuildLocaleIndex.pas';
begin
try
DevUtils.Run;
except
on E: Exception do
begin
Writeln(E.ClassName, ': ', E.Message);
ExitCode := 5;
end;
end;
end.