mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Enable Chinese online help
This commit is contained in:
parent
624384091f
commit
694b14cf43
2 changed files with 24 additions and 8 deletions
|
|
@ -1 +1,2 @@
|
||||||
ru
|
ru
|
||||||
|
zh
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
Help manager
|
Help manager
|
||||||
|
|
||||||
Copyright (C) 2008-2021 Alexander Koblov (alexx2000@mail.ru)
|
Copyright (C) 2008-2026 Alexander Koblov (alexx2000@mail.ru)
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -101,20 +101,35 @@ var
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
var
|
var
|
||||||
ATranslations: TStringList;
|
ATranslations: TStringList;
|
||||||
|
|
||||||
|
function CheckHelp(const HelpLang: String): Boolean;
|
||||||
|
begin
|
||||||
|
Result:= mbDirectoryExists(gpExePath + 'doc' + PathDelim + HelpLang);
|
||||||
|
if not Result then Result:= ATranslations.IndexOf(HelpLang) >= 0;
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if NumCountChars('.', gPOFileName) < 2 then
|
if NumCountChars('.', gPOFileName) < 2 then
|
||||||
gHelpLang:= 'en'
|
gHelpLang:= 'en'
|
||||||
else begin
|
else begin
|
||||||
gHelpLang:= ExtractDelimited(2, gPOFileName, ['.']);
|
ATranslations:= TStringListEx.Create;
|
||||||
if not mbDirectoryExists(gpExePath + 'doc' + PathDelim + gHelpLang) then
|
try
|
||||||
begin
|
gHelpLang:= ExtractDelimited(2, gPOFileName, ['.']);
|
||||||
ATranslations:= TStringListEx.Create;
|
|
||||||
try
|
try
|
||||||
ATranslations.LoadFromFile(gpExePath + 'doublecmd.help');
|
ATranslations.LoadFromFile(gpExePath + 'doublecmd.help');
|
||||||
if ATranslations.IndexOf(gHelpLang) < 0 then gHelpLang:= 'en';
|
|
||||||
except
|
except
|
||||||
gHelpLang:= 'en';
|
// Ignore
|
||||||
end;
|
end;
|
||||||
|
if not CheckHelp(gHelpLang) then
|
||||||
|
begin
|
||||||
|
if Pos('_', gHelpLang) = 0 then
|
||||||
|
gHelpLang:= 'en'
|
||||||
|
else begin
|
||||||
|
gHelpLang:= ExtractDelimited(1, gHelpLang, ['_']);
|
||||||
|
if not CheckHelp(gHelpLang) then gHelpLang:= 'en';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
ATranslations.Free;
|
ATranslations.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue