IDE: retranslate editor options

git-svn-id: trunk@41709 -
This commit is contained in:
mattias 2013-06-13 22:51:16 +00:00
parent dac652c7fc
commit 87b70e8023
4 changed files with 18 additions and 3 deletions

View File

@ -1419,6 +1419,7 @@ type
procedure Init; procedure Init;
procedure Load; procedure Load;
procedure Save; procedure Save;
procedure TranslateResourceStrings;
function GetAdditionalAttributeName(aha:TAdditionalHilightAttribute): string; function GetAdditionalAttributeName(aha:TAdditionalHilightAttribute): string;
function GetSynEditOptionName(SynOption: TSynEditorOption): string; function GetSynEditOptionName(SynOption: TSynEditorOption): string;
function GetSynBeautifierIndentName(IndentType: TSynBeautifierIndentType): string; function GetSynBeautifierIndentName(IndentType: TSynBeautifierIndentType): string;
@ -4465,7 +4466,6 @@ begin
FStringBreakEnabled := False; FStringBreakEnabled := False;
FStringBreakAppend := ' +'; FStringBreakAppend := ' +';
FStringBreakPrefix := ''; FStringBreakPrefix := '';
end; end;
procedure TEditorOptions.Load; procedure TEditorOptions.Load;
@ -4870,9 +4870,14 @@ begin
end; end;
end; end;
procedure TEditorOptions.TranslateResourceStrings;
begin
end;
function TEditorOptions.GetAdditionalAttributeName(aha:TAdditionalHilightAttribute): string; function TEditorOptions.GetAdditionalAttributeName(aha:TAdditionalHilightAttribute): string;
begin begin
result:=GetEnumName(TypeInfo(TAdditionalHilightAttribute), ord(aha)); Result:=GetEnumName(TypeInfo(TAdditionalHilightAttribute), ord(aha));
end; end;
class function TEditorOptions.GetGroupCaption: string; class function TEditorOptions.GetGroupCaption: string;

View File

@ -992,6 +992,7 @@ type
procedure SaveEnvironment(Immediately: boolean = false); override; procedure SaveEnvironment(Immediately: boolean = false); override;
procedure LoadDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions); procedure LoadDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
procedure SaveDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions); procedure SaveDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
procedure PackageTranslated(APackage: TLazPackage); override;
end; end;
@ -4612,6 +4613,13 @@ begin
TheEnvironmentOptions.ObjectInspectorOptions.Assign(ObjectInspector1); TheEnvironmentOptions.ObjectInspectorOptions.Assign(ObjectInspector1);
end; end;
procedure TMainIDE.PackageTranslated(APackage: TLazPackage);
begin
if APackage=PackageGraph.SynEditPackage then begin
EditorOpts.TranslateResourceStrings;
end;
end;
procedure TMainIDE.LoadDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions); procedure TMainIDE.LoadDesktopSettings(TheEnvironmentOptions: TEnvironmentOptions);
begin begin
if ObjectInspector1<>nil then if ObjectInspector1<>nil then

View File

@ -70,7 +70,7 @@ uses
ProjectDefs, Project, PublishModule, BuildLazDialog, ProjectDefs, Project, PublishModule, BuildLazDialog,
TransferMacros, IDEDefs, ProgressDlg, TransferMacros, IDEDefs, ProgressDlg,
EnvironmentOpts, EditorOptions, CompilerOptions, KeyMapping, IDEProcs, EnvironmentOpts, EditorOptions, CompilerOptions, KeyMapping, IDEProcs,
IDEOptionDefs; IDEOptionDefs, PackageDefs;
type type
// The IDE is at anytime in a specific state: // The IDE is at anytime in a specific state:
@ -185,6 +185,7 @@ type
procedure SaveEnvironment(Immediately: boolean = false); virtual; abstract; procedure SaveEnvironment(Immediately: boolean = false); virtual; abstract;
procedure UpdateHighlighters(Immediately: boolean = false); virtual; abstract; procedure UpdateHighlighters(Immediately: boolean = false); virtual; abstract;
procedure PackageTranslated(APackage: TLazPackage); virtual; abstract;
procedure SetRecentSubMenu(Section: TIDEMenuSection; FileList: TStringList; procedure SetRecentSubMenu(Section: TIDEMenuSection; FileList: TStringList;
OnClickEvent: TNotifyEvent); virtual; abstract; OnClickEvent: TNotifyEvent); virtual; abstract;
function DoJumpToSourcePosition(const Filename: string; function DoJumpToSourcePosition(const Filename: string;

View File

@ -1905,6 +1905,7 @@ begin
TranslateWithFileMask(APackage,Directory,FallbackLang); TranslateWithFileMask(APackage,Directory,FallbackLang);
finally finally
TranslatedUnits.Free; TranslatedUnits.Free;
MainIDEInterface.PackageTranslated(APackage);
end; end;
end; end;