Changeset 10


Ignore:
Timestamp:
Jan 25, 2015, 9:54:33 PM (10 years ago)
Author:
chronos
Message:
  • Added: Option to choose interface language.
  • Added: Source of used packages.
Location:
trunk
Files:
104 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormPreferences.lfm

    r9 r10  
    2121    Top = 376
    2222    Width = 75
     23    Anchors = [akRight, akBottom]
    2324    Caption = 'Save'
    2425    ModalResult = 1
     
    3031    Top = 375
    3132    Width = 75
     33    Anchors = [akRight, akBottom]
    3234    Caption = 'Cancel'
    3335    ModalResult = 2
    3436    TabOrder = 2
    3537  end
     38  object ComboBoxLanguage: TComboBox
     39    Left = 192
     40    Height = 35
     41    Top = 64
     42    Width = 292
     43    ItemHeight = 0
     44    Style = csDropDownList
     45    TabOrder = 3
     46  end
     47  object Label1: TLabel
     48    Left = 18
     49    Height = 25
     50    Top = 65
     51    Width = 95
     52    Caption = 'Language:'
     53    ParentColor = False
     54  end
    3655end
  • trunk/Forms/UFormPreferences.pas

    r9 r10  
    1616    ButtonCancel: TButton;
    1717    CheckBoxRememberDatabase: TCheckBox;
     18    ComboBoxLanguage: TComboBox;
     19    Label1: TLabel;
    1820  private
    1921    { private declarations }
     
    3032{$R *.lfm}
    3133
     34uses
     35  UCore, ULanguages;
     36
    3237{ TFormPreferences }
    3338
     
    3540begin
    3641  CheckBoxRememberDatabase.Checked := Preferences.RememberDatabase;
     42  Core.CoolTranslator1.LanguageListToStrings(ComboBoxLanguage.Items);
     43  ComboBoxLanguage.ItemIndex := ComboBoxLanguage.Items.IndexOfObject(Core.CoolTranslator1.Language);
     44  if ComboBoxLanguage.ItemIndex = -1 then ComboBoxLanguage.ItemIndex := 0;
    3745end;
    3846
     
    4048begin
    4149  Preferences.RememberDatabase := CheckBoxRememberDatabase.Checked;
     50  if ComboBoxLanguage.ItemIndex <> -1 then
     51    Core.CoolTranslator1.Language := TLanguage(ComboBoxLanguage.Items.Objects[ComboBoxLanguage.ItemIndex]);
    4252end;
    4353
  • trunk/MyData.lpi

    r9 r10  
    1212    </General>
    1313    <i18n>
    14       <EnableI18N LFM="False"/>
     14      <EnableI18N Value="True"/>
     15      <OutDir Value="Languages"/>
    1516    </i18n>
    1617    <VersionInfo>
     
    6768      </local>
    6869    </RunParams>
    69     <RequiredPackages Count="3">
     70    <RequiredPackages Count="5">
    7071      <Item1>
    71         <PackageName Value="FCL"/>
     72        <PackageName Value="TemplateGenerics"/>
     73        <DefaultFilename Value="Packages/TemplateGenerics/TemplateGenerics.lpk" Prefer="True"/>
    7274      </Item1>
    7375      <Item2>
    74         <PackageName Value="Common"/>
     76        <PackageName Value="CoolTranslator"/>
     77        <DefaultFilename Value="Packages/CoolTranslator/CoolTranslator.lpk" Prefer="True"/>
    7578      </Item2>
    7679      <Item3>
     80        <PackageName Value="FCL"/>
     81      </Item3>
     82      <Item4>
     83        <PackageName Value="Common"/>
     84        <DefaultFilename Value="Packages/Common/Common.lpk" Prefer="True"/>
     85      </Item4>
     86      <Item5>
    7787        <PackageName Value="LCL"/>
    78       </Item3>
     88      </Item5>
    7989    </RequiredPackages>
    8090    <Units Count="17">
  • trunk/MyData.lpr

    r9 r10  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   Forms, UFormTables, UDatabase, UCore, Common, UEngineXML, UFormTable,
    11   UFormRecords, UFormRecord, UFormFields, UFormField, UDataTypes, UEngineMySQL,
    12   UEngineSQLite, UFormMain, UFormConnect, UFormDatabases, UFormPreferences;
     10  Forms, UFormTables, UDatabase, UCore, Common, CoolTranslator, UEngineXML,
     11  UFormTable, UFormRecords, UFormRecord, UFormFields, UFormField, UDataTypes,
     12  TemplateGenerics, UEngineMySQL, UEngineSQLite, UFormMain, UFormConnect,
     13  UFormDatabases, UFormPreferences;
    1314
    1415{$R *.res}
  • trunk/UCore.lfm

    r9 r10  
    14561456    end
    14571457  end
     1458  object CoolTranslator1: TCoolTranslator
     1459    POFilesFolder = 'Languages'
     1460    left = 288
     1461    top = 304
     1462  end
    14581463end
  • trunk/UCore.pas

    r9 r10  
    66
    77uses
    8   Classes, SysUtils, XMLConf, FileUtil, Controls, ActnList, UDatabase, Forms;
     8  Classes, SysUtils, XMLConf, FileUtil, Controls, ActnList, UDatabase,
     9  UCoolTranslator, Forms;
    910
    1011type
     
    1718    AExit: TAction;
    1819    ActionList1: TActionList;
     20    CoolTranslator1: TCoolTranslator;
    1921    ImageList1: TImageList;
    2022    XMLConfig1: TXMLConfig;
     
    163165  Preferences.RememberDatabase := XMLConfig1.GetValue('RememberDatabase', True);
    164166  Preferences.LastDatabaseName := XMLConfig1.GetValue('LastDatabaseName', '');
     167  CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(XMLConfig1.GetValue('Language', ''));
    165168end;
    166169
     
    177180  XMLConfig1.SetValue('RememberDatabase', Preferences.RememberDatabase);
    178181  XMLConfig1.SetValue('LastDatabaseName', Preferences.LastDatabaseName);
     182  XMLConfig1.SetValue('Language', CoolTranslator1.Language.Code);
    179183end;
    180184
Note: See TracChangeset for help on using the changeset viewer.