mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-13 17:37:31 +00:00
Merge pull request #6727 from keymanapp/fix/windows/6619/install-tip-crash-bcp47tag
fix(windows): Install TIP crash with inconsistent bcp47tag
This commit is contained in:
commit
e2edb7db0e
1 changed files with 6 additions and 4 deletions
|
|
@ -32,13 +32,15 @@ type
|
|||
class function GetFirstLanguage(Keyboard: IKeymanKeyboardInstalled): string; overload;
|
||||
class function GetFirstLanguage(Keyboard: IKeymanKeyboardFile): string; overload;
|
||||
|
||||
/// <summary>Get the BCP47 tag for the user's default language</summary>
|
||||
/// <summary>Get the canonicalized BCP47 tag for the user's default language</summary>
|
||||
class function GetUserDefaultLanguage: string; overload; static;
|
||||
class procedure GetUserDefaultLanguage(var BCP47: string; var LangID: Integer); overload; static;
|
||||
|
||||
/// <summary>Get the -default-lang parameter string for kmshell</summary>
|
||||
/// <summary>Get the canonicalized -default-lang parameter string for kmshell</summary>
|
||||
class function GetUserDefaultLangParameterString: string; static;
|
||||
private
|
||||
// Get the IKeymanKeyboardLanguageInstalled Object corresponding to the BCBP47Tag or **Add** it if not found for the supplied KeyboardID.
|
||||
// Returns Nil if no Keyboard is found with the supplied KeyboardID.
|
||||
class function GetKeyboardLanguage(const KeyboardID,
|
||||
BCP47Tag: string): IKeymanKeyboardLanguageInstalled; static;
|
||||
end;
|
||||
|
|
@ -342,7 +344,7 @@ begin
|
|||
if r.OpenKeyReadOnly('\' + SRegKey_ControlPanelInternationalUserProfile + '\' + key) and
|
||||
r.ValueExists(v) then
|
||||
begin
|
||||
BCP47 := key;
|
||||
BCP47 := (kmcom as IKeymanBCP47Canonicalization).GetCanonicalTag(key);
|
||||
LangID := GetLangIDFromValueName;
|
||||
Break;
|
||||
end;
|
||||
|
|
@ -359,7 +361,7 @@ begin
|
|||
r.ReadMultiString(SRegValue_CPIUP_Languages, tags);
|
||||
if tags.Count > 0 then
|
||||
begin
|
||||
BCP47 := tags[0].Trim;
|
||||
BCP47 := (kmcom as IKeymanBCP47Canonicalization).GetCanonicalTag(tags[0].Trim);
|
||||
if r.OpenKeyReadOnly('\' + SRegKey_ControlPanelInternationalUserProfile + '\' + BCP47) then
|
||||
LangID := GetLangIDFromValueName;
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue