mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:39:22 +02:00
IDE, Options: Translate "restart hint" to new language
This commit is contained in:
parent
6d5a09d6a1
commit
a8fbf8ab7c
@ -29,7 +29,7 @@ uses
|
|||||||
// LCL
|
// LCL
|
||||||
Forms, StdCtrls, Dialogs, Controls, ExtCtrls, Spin,
|
Forms, StdCtrls, Dialogs, Controls, ExtCtrls, Spin,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
FileUtil, LazUTF8, LazLoggerBase,
|
FileUtil, LazUTF8, LazLoggerBase, Translations,
|
||||||
// LazControls
|
// LazControls
|
||||||
DividerBevel,
|
DividerBevel,
|
||||||
// IdeIntf
|
// IdeIntf
|
||||||
@ -354,8 +354,21 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDesktopOptionsFrame.LanguageComboBoxChange(Sender: TObject);
|
procedure TDesktopOptionsFrame.LanguageComboBoxChange(Sender: TObject);
|
||||||
|
var
|
||||||
|
po: TPOFile;
|
||||||
|
s: String;
|
||||||
begin
|
begin
|
||||||
lblLangChangeHint.Visible := LanguageComboBox.Text <> fCurrentLang;
|
lblLangChangeHint.Visible := LanguageComboBox.Text <> fCurrentLang;
|
||||||
|
po := GetLazIdePoFile(EnvironmentOptions.GetParsedLazarusDirectory,
|
||||||
|
CaptionToLangID(LanguageComboBox.Text));
|
||||||
|
if po <> nil then begin
|
||||||
|
s := po.Translate('lazarusidestrconsts.dlgEnvLanguageHint','');
|
||||||
|
if s <> '' then
|
||||||
|
lblLangChangeHint.Caption := s
|
||||||
|
else
|
||||||
|
lblLangChangeHint.Caption := dlgEnvLanguageHint;
|
||||||
|
po.Free;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDesktopOptionsFrame.LangIDToCaption(const LangID: string): string;
|
function TDesktopOptionsFrame.LangIDToCaption(const LangID: string): string;
|
||||||
|
@ -74,6 +74,8 @@ type
|
|||||||
// translate all resource strings
|
// translate all resource strings
|
||||||
procedure TranslateResourceStrings(const LazarusDir, CustomLang: string);
|
procedure TranslateResourceStrings(const LazarusDir, CustomLang: string);
|
||||||
|
|
||||||
|
function GetLazIdePoFile(const LazarusDir, CustomLang: string): TPOFile;
|
||||||
|
|
||||||
// get language name for ID
|
// get language name for ID
|
||||||
function GetLazarusLanguageLocalizedName(const ID: string): String;
|
function GetLazarusLanguageLocalizedName(const ID: string): String;
|
||||||
|
|
||||||
@ -527,6 +529,19 @@ begin
|
|||||||
Dir+'lcl/languages/lclstrconsts'+Ext,Lang,FallbackLang);
|
Dir+'lcl/languages/lclstrconsts'+Ext,Lang,FallbackLang);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function GetLazIdePoFile(const LazarusDir, CustomLang: string): TPOFile;
|
||||||
|
const
|
||||||
|
Ext = '.%s.po';
|
||||||
|
var
|
||||||
|
AFilename: String;
|
||||||
|
begin
|
||||||
|
Result := nil;
|
||||||
|
AFilename:=Format(AppendPathDelim(LazarusDir)+'languages/lazaruside'+Ext, [CustomLang]);
|
||||||
|
if FileExistsUTF8(AFilename) then
|
||||||
|
Result := TPOFile.Create(AFilename);
|
||||||
|
end;
|
||||||
|
|
||||||
{ TLazarusTranslations }
|
{ TLazarusTranslations }
|
||||||
|
|
||||||
function TLazarusTranslations.GetItems(Index: integer): TLazarusTranslation;
|
function TLazarusTranslations.GetItems(Index: integer): TLazarusTranslation;
|
||||||
|
Loading…
Reference in New Issue
Block a user