mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-02-19 18:36:42 +01:00
DefaultTranslator: make --lang commandline parameter override all other methods of getting LanguageID. Patch from Stephano, bug #17218.
git-svn-id: trunk@27158 -
This commit is contained in:
parent
e096a0f121
commit
7daa7004e0
@ -176,21 +176,23 @@ var
|
||||
|
||||
begin
|
||||
Result := '';
|
||||
//Win32 user may decide to override locale with LANG variable.
|
||||
Lang := GetEnvironmentVariableUTF8('LANG');
|
||||
if Lang = '' then
|
||||
begin
|
||||
Lang := '';
|
||||
|
||||
for i := 1 to Paramcount - 1 do
|
||||
if (ParamStrUTF8(i) = '--LANG') or (ParamStrUTF8(i) = '-l') or
|
||||
(ParamStrUTF8(i) = '--lang') then
|
||||
Lang := ParamStrUTF8(i + 1);
|
||||
end;
|
||||
|
||||
//Win32 user may decide to override locale with LANG variable.
|
||||
if Lang = '' then
|
||||
Lang := GetEnvironmentVariableUTF8('LANG');
|
||||
|
||||
if Lang = '' then
|
||||
LCLGetLanguageIDs(Lang, T);
|
||||
|
||||
Result := GetLocaleFileName(Lang, LCExt);
|
||||
if Result <> '' then
|
||||
Exit;
|
||||
exit;
|
||||
|
||||
Result := ChangeFileExt(ParamStrUTF8(0), LCExt);
|
||||
if FileExistsUTF8(Result) then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user