mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 19:19:19 +02:00
LCL, LCLTranslator: When finding language ID, don't always explicitly analyze LANG variable, let LazGetLanguageIDs procedure do its job instead.
LazGetLanguageIDs will look at LANG on Linux/Unix just fine (and in correct order, see issue #37937), and on Windows this is non-standard location and thus using it can potentially lead to unexpected results.
This commit is contained in:
parent
917c994925
commit
d8f4c3990b
@ -114,16 +114,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//User can decide to override locale with LANG variable.
|
|
||||||
if Lang = '' then
|
|
||||||
Lang := GetEnvironmentVariableUTF8('LANG');
|
|
||||||
|
|
||||||
if Lang = '' then
|
if Lang = '' then
|
||||||
LazGetLanguageIDs(Lang, T);
|
LazGetLanguageIDs(Lang, T);
|
||||||
|
|
||||||
//Trim encoding from Lang if it presents. E. g. Lang can be `ru_RU.utf8`.
|
|
||||||
if Lang <> '' then
|
|
||||||
LazTrimLanguageID(Lang);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function FindLocaleFileName(LCExt, LangID, Dir, LocaleFileName: string; out FoundLang: string): string;
|
function FindLocaleFileName(LCExt, LangID, Dir, LocaleFileName: string; out FoundLang: string): string;
|
||||||
|
Loading…
Reference in New Issue
Block a user