Changeset 25 for trunk/UCore.pas
- Timestamp:
- Sep 10, 2022, 6:54:43 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UCore.pas
r22 r25 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, Controls, ActnList, UDatabase, U CoolTranslator,8 Classes, SysUtils, FileUtil, Controls, ActnList, UDatabase, UTranslator, 9 9 UApplicationInfo, UPersistentForm, Forms, URegistry, UScaleDPI; 10 10 … … 20 20 AExit: TAction; 21 21 ActionList1: TActionList; 22 CoolTranslator1: TCoolTranslator;22 Translator1: TTranslator; 23 23 ImageList1: TImageList; 24 24 PersistentForm1: TPersistentForm; … … 29 29 procedure AExitExecute(Sender: TObject); 30 30 procedure APreferencesExecute(Sender: TObject); 31 procedure CoolTranslator1Translate(Sender: TObject);31 procedure Translator1Translate(Sender: TObject); 32 32 procedure DataModuleCreate(Sender: TObject); 33 33 procedure DataModuleDestroy(Sender: TObject); … … 57 57 58 58 uses 59 UFormTables, UFormConnect, 60 UForm Databases, UFormPreferences, UFormMain, UFormAbout;59 UFormTables, UFormConnect, UAboutDialog, UFormDatabases, UFormPreferences, 60 UFormMain; 61 61 62 62 {$R *.lfm} … … 97 97 procedure TCore.AAboutExecute(Sender: TObject); 98 98 begin 99 FormAbout := TFormAbout.Create(nil); 100 FormAbout.ApplicationInfo := ApplicationInfo1; 101 FormAbout.ShowModal; 102 FormAbout.Free; 99 with TAboutDialog.Create(nil) do 100 try 101 ApplicationInfo := ApplicationInfo1; 102 Show; 103 finally 104 Free; 105 end; 103 106 end; 104 107 … … 111 114 end; 112 115 113 procedure TCore. CoolTranslator1Translate(Sender: TObject);116 procedure TCore.Translator1Translate(Sender: TObject); 114 117 var 115 118 I: Integer; 116 119 begin 117 120 for I := 0 to DbManager.DataTypes.Count - 1 do begin 118 TDataType(DbManager.DataTypes[I]).Title := CoolTranslator1.TranslateText(TDataType(DbManager.DataTypes[I]).Title, TDataType(DbManager.DataTypes[I]).Title);121 TDataType(DbManager.DataTypes[I]).Title := Translator1.TranslateText(TDataType(DbManager.DataTypes[I]).Title, TDataType(DbManager.DataTypes[I]).Title); 119 122 end; 120 123 end; … … 143 146 Preferences.RememberDatabase := GetValue('RememberDatabase', True); 144 147 Preferences.LastDatabaseName := GetValue('LastDatabaseName', ''); 145 CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(148 Translator1.Language := Translator1.Languages.SearchByCode( 146 149 GetValue('Language', '')); 147 150 finally … … 158 161 SetValue('RememberDatabase', Preferences.RememberDatabase); 159 162 SetValue('LastDatabaseName', Preferences.LastDatabaseName); 160 SetValue('Language', CoolTranslator1.Language.Code);163 SetValue('Language', Translator1.Language.Code); 161 164 finally 162 165 Free; … … 170 173 begin 171 174 if not Initialized then begin 172 {$IFDEF Linux}175 {$IFDEF UNIX} 173 176 // If installed in Linux system then use installation directory for po files 174 177 if Application.ExeName = '/usr/bin/MyData' then 175 CoolTranslator1.POFilesFolder := '/usr/share/MyData/languages';178 Translator1.POFilesFolder := '/usr/share/MyData/languages'; 176 179 {$ENDIF} 177 180 FormConnect.Init;
Note:
See TracChangeset
for help on using the changeset viewer.