mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-15 14:29:31 +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
|
||||
Forms, StdCtrls, Dialogs, Controls, ExtCtrls, Spin,
|
||||
// LazUtils
|
||||
FileUtil, LazUTF8, LazLoggerBase,
|
||||
FileUtil, LazUTF8, LazLoggerBase, Translations,
|
||||
// LazControls
|
||||
DividerBevel,
|
||||
// IdeIntf
|
||||
@ -354,8 +354,21 @@ begin
|
||||
end;
|
||||
|
||||
procedure TDesktopOptionsFrame.LanguageComboBoxChange(Sender: TObject);
|
||||
var
|
||||
po: TPOFile;
|
||||
s: String;
|
||||
begin
|
||||
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;
|
||||
|
||||
function TDesktopOptionsFrame.LangIDToCaption(const LangID: string): string;
|
||||
|
@ -74,6 +74,8 @@ type
|
||||
// translate all resource strings
|
||||
procedure TranslateResourceStrings(const LazarusDir, CustomLang: string);
|
||||
|
||||
function GetLazIdePoFile(const LazarusDir, CustomLang: string): TPOFile;
|
||||
|
||||
// get language name for ID
|
||||
function GetLazarusLanguageLocalizedName(const ID: string): String;
|
||||
|
||||
@ -527,6 +529,19 @@ begin
|
||||
Dir+'lcl/languages/lclstrconsts'+Ext,Lang,FallbackLang);
|
||||
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 }
|
||||
|
||||
function TLazarusTranslations.GetItems(Index: integer): TLazarusTranslation;
|
||||
|
Loading…
Reference in New Issue
Block a user