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
|
begin
|
||||||
Result := '';
|
Result := '';
|
||||||
|
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);
|
||||||
|
|
||||||
//Win32 user may decide to override locale with LANG variable.
|
//Win32 user may decide to override locale with LANG variable.
|
||||||
Lang := GetEnvironmentVariableUTF8('LANG');
|
|
||||||
if Lang = '' then
|
if Lang = '' then
|
||||||
begin
|
Lang := GetEnvironmentVariableUTF8('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;
|
|
||||||
if Lang = '' then
|
if Lang = '' then
|
||||||
LCLGetLanguageIDs(Lang, T);
|
LCLGetLanguageIDs(Lang, T);
|
||||||
|
|
||||||
Result := GetLocaleFileName(Lang, LCExt);
|
Result := GetLocaleFileName(Lang, LCExt);
|
||||||
if Result <> '' then
|
if Result <> '' then
|
||||||
Exit;
|
exit;
|
||||||
|
|
||||||
Result := ChangeFileExt(ParamStrUTF8(0), LCExt);
|
Result := ChangeFileExt(ParamStrUTF8(0), LCExt);
|
||||||
if FileExistsUTF8(Result) then
|
if FileExistsUTF8(Result) then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user