Ignore:
Timestamp:
Sep 8, 2012, 9:28:39 PM (12 years ago)
Author:
chronos
Message:
  • Updated: Component versions.
  • Added: Missing forms.
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        33backup
        44tunneler.exe
         5heaptrclog.trc
  • trunk/Components/CoolTranslator

    • Property svn:ignore set to
      lib
  • trunk/Components/CoolTranslator/Demo/Languages/TranslatorDemo.cs.po

    r29 r30  
    1919msgstr "Ukázat MainForm.Name"
    2020
     21#: TMAINFORM.CAPTION
     22msgctxt "TMAINFORM.CAPTION"
     23msgid "Translator Demo"
     24msgstr "Ukázka Translatoru"
     25
    2126#: TMAINFORM.LABEL1.CAPTION
    2227msgid "MainForm"
     
    3540msgstr ""
    3641
    37 #: TMAINFORM.MAINFORM.CAPTION
    38 msgctxt "TMAINFORM.MAINFORM.CAPTION"
    39 msgid "Translator Demo"
    40 msgstr "Ukázka Translatoru"
    41 
    4242#: umainform.stranslatedtext
    4343msgid "Text stored in resourcestring"
  • trunk/Components/CoolTranslator/Demo/Languages/TranslatorDemo.de.po

    r29 r30  
    99#: TMAINFORM.BUTTON1.CAPTION
    1010msgid "Show MainForm.Name"
     11msgstr ""
     12
     13#: TMAINFORM.CAPTION
     14msgctxt "TMAINFORM.CAPTION"
     15msgid "Translator Demo"
    1116msgstr ""
    1217
     
    2732msgstr ""
    2833
    29 #: TMAINFORM.MAINFORM.CAPTION
    30 msgctxt "TMAINFORM.MAINFORM.CAPTION"
    31 msgid "Translator Demo"
    32 msgstr ""
    33 
    3434#: umainform.stranslatedtext
    3535msgid "Text stored in resourcestring"
  • trunk/Components/CoolTranslator/Demo/Languages/TranslatorDemo.po

    r29 r30  
    99#: TMAINFORM.BUTTON1.CAPTION
    1010msgid "Show MainForm.Name"
     11msgstr ""
     12
     13#: TMAINFORM.CAPTION
     14msgctxt "TMAINFORM.CAPTION"
     15msgid "Translator Demo"
    1116msgstr ""
    1217
     
    2732msgstr ""
    2833
    29 #: TMAINFORM.MAINFORM.CAPTION
    30 msgctxt "TMAINFORM.MAINFORM.CAPTION"
    31 msgid "Translator Demo"
    32 msgstr ""
    33 
    3434#: umainform.stranslatedtext
    3535msgid "Text stored in resourcestring"
  • trunk/Components/CoolTranslator/Demo/TranslatorDemo.lpi

    r29 r30  
    4040      </Item2>
    4141    </RequiredPackages>
    42     <Units Count="11">
     42    <Units Count="12">
    4343      <Unit0>
    4444        <Filename Value="TranslatorDemo.lpr"/>
     
    5555        <EditorIndex Value="0"/>
    5656        <WindowIndex Value="0"/>
    57         <TopLine Value="39"/>
    58         <CursorPos X="45" Y="48"/>
     57        <TopLine Value="1"/>
     58        <CursorPos X="29" Y="18"/>
    5959        <UsageCount Value="21"/>
    6060        <Loaded Value="True"/>
     
    6464        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\Lazarus\lcl\stdctrls.pp"/>
    6565        <UnitName Value="StdCtrls"/>
    66         <EditorIndex Value="8"/>
    6766        <WindowIndex Value="0"/>
    6867        <TopLine Value="565"/>
    6968        <CursorPos X="24" Y="577"/>
    7069        <UsageCount Value="11"/>
    71         <Loaded Value="True"/>
    7270      </Unit2>
    7371      <Unit3>
    7472        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\FPC\rtl\objpas\classes\classesh.inc"/>
    75         <EditorIndex Value="9"/>
    7673        <WindowIndex Value="0"/>
    7774        <TopLine Value="686"/>
    7875        <CursorPos X="3" Y="659"/>
    7976        <UsageCount Value="11"/>
    80         <Loaded Value="True"/>
    8177      </Unit3>
    8278      <Unit4>
    8379        <Filename Value="..\UCoolTranslator.pas"/>
    8480        <UnitName Value="UCoolTranslator"/>
    85         <EditorIndex Value="3"/>
     81        <IsVisibleTab Value="True"/>
     82        <EditorIndex Value="1"/>
    8683        <WindowIndex Value="0"/>
    8784        <TopLine Value="274"/>
    88         <CursorPos X="29" Y="279"/>
     85        <CursorPos X="1" Y="286"/>
    8986        <UsageCount Value="11"/>
    9087        <Loaded Value="True"/>
     
    9289      <Unit5>
    9390        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\Lazarus\lcl\include\customlistbox.inc"/>
    94         <EditorIndex Value="2"/>
    9591        <WindowIndex Value="0"/>
    9692        <TopLine Value="524"/>
    9793        <CursorPos X="1" Y="535"/>
    9894        <UsageCount Value="10"/>
    99         <Loaded Value="True"/>
    10095      </Unit5>
    10196      <Unit6>
    10297        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\Lazarus\lcl\interfaces\win32\win32listsl.inc"/>
    103         <EditorIndex Value="1"/>
    10498        <WindowIndex Value="0"/>
    10599        <TopLine Value="226"/>
    106100        <CursorPos X="1" Y="238"/>
    107101        <UsageCount Value="10"/>
    108         <Loaded Value="True"/>
    109102      </Unit6>
    110103      <Unit7>
    111104        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\Lazarus\lcl\include\winfileutil.inc"/>
    112         <EditorIndex Value="6"/>
    113105        <WindowIndex Value="0"/>
    114106        <TopLine Value="549"/>
    115107        <CursorPos X="1" Y="566"/>
    116108        <UsageCount Value="10"/>
    117         <Loaded Value="True"/>
    118109      </Unit7>
    119110      <Unit8>
    120111        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\Lazarus\lcl\translations.pas"/>
    121112        <UnitName Value="Translations"/>
    122         <IsVisibleTab Value="True"/>
    123         <EditorIndex Value="7"/>
    124113        <WindowIndex Value="0"/>
    125114        <TopLine Value="747"/>
    126115        <CursorPos X="54" Y="759"/>
    127116        <UsageCount Value="10"/>
    128         <Loaded Value="True"/>
    129117      </Unit8>
    130118      <Unit9>
    131119        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\Lazarus\lcl\include\control.inc"/>
    132         <EditorIndex Value="5"/>
    133120        <WindowIndex Value="0"/>
    134121        <TopLine Value="2702"/>
    135122        <CursorPos X="18" Y="2717"/>
    136123        <UsageCount Value="10"/>
    137         <Loaded Value="True"/>
    138124      </Unit9>
    139125      <Unit10>
    140126        <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\FPC\rtl\inc\objpash.inc"/>
    141         <EditorIndex Value="4"/>
    142127        <WindowIndex Value="0"/>
    143128        <TopLine Value="189"/>
    144129        <CursorPos X="26" Y="201"/>
    145130        <UsageCount Value="10"/>
     131      </Unit10>
     132      <Unit11>
     133        <Filename Value="..\ULanguages.pas"/>
     134        <UnitName Value="ULanguages"/>
     135        <EditorIndex Value="2"/>
     136        <WindowIndex Value="0"/>
     137        <TopLine Value="1"/>
     138        <CursorPos X="32" Y="10"/>
     139        <UsageCount Value="10"/>
    146140        <Loaded Value="True"/>
    147       </Unit10>
     141      </Unit11>
    148142    </Units>
    149143    <JumpHistory Count="30" HistoryIndex="29">
     
    253247      </Position26>
    254248      <Position27>
    255         <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\Lazarus\lcl\translations.pas"/>
    256         <Caret Line="759" Column="1" TopLine="747"/>
     249        <Filename Value="UMainForm.pas"/>
     250        <Caret Line="48" Column="45" TopLine="39"/>
    257251      </Position27>
    258252      <Position28>
    259         <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\Lazarus\lcl\translations.pas"/>
    260         <Caret Line="760" Column="1" TopLine="747"/>
     253        <Filename Value="UMainForm.pas"/>
     254        <Caret Line="59" Column="20" TopLine="39"/>
    261255      </Position28>
    262256      <Position29>
    263         <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\Lazarus\lcl\translations.pas"/>
    264         <Caret Line="761" Column="1" TopLine="747"/>
     257        <Filename Value="UMainForm.pas"/>
     258        <Caret Line="9" Column="29" TopLine="1"/>
    265259      </Position29>
    266260      <Position30>
    267         <Filename Value="E:\Projekty2\FreePascalManager\trunk\Instance\5\Lazarus\lcl\translations.pas"/>
    268         <Caret Line="762" Column="1" TopLine="747"/>
     261        <Filename Value="UMainForm.pas"/>
     262        <Caret Line="18" Column="29" TopLine="1"/>
    269263      </Position30>
    270264    </JumpHistory>
    271265  </ProjectOptions>
    272266  <CompilerOptions>
    273     <Version Value="9"/>
     267    <Version Value="10"/>
    274268    <PathDelim Value="\"/>
    275269    <Target>
     
    281275    </SearchPaths>
    282276    <Linking>
     277      <Debugging>
     278        <GenerateDebugInfo Value="True"/>
     279        <DebugInfoType Value="dsAuto"/>
     280      </Debugging>
    283281      <Options>
    284282        <Win32>
     
    295293  </CompilerOptions>
    296294  <Debugging>
    297     <BreakPoints Count="1">
    298       <Item1>
    299         <Source Value="..\UCoolTranslator.pas"/>
    300         <Line Value="279"/>
    301       </Item1>
    302     </BreakPoints>
    303295    <Exceptions Count="3">
    304296      <Item1>
  • trunk/Components/CoolTranslator/Demo/UMainForm.lfm

    r29 r30  
    88  ClientWidth = 466
    99  OnCreate = FormCreate
    10   LCLVersion = '0.9.30.1'
     10  LCLVersion = '0.9.31'
    1111  object ListBox1: TListBox
    1212    Left = 171
     
    6868  end
    6969  object CoolTranslator1: TCoolTranslator
     70    POFilesFolder = 'Languages'
    7071    left = 64
    7172    top = 40
  • trunk/Components/CoolTranslator/Demo/UMainForm.lrt

    r29 r30  
    1 TMAINFORM.MAINFORM.CAPTION=Translator Demo
     1TMAINFORM.CAPTION=Translator Demo
    22TMAINFORM.BUTTON1.CAPTION=Show MainForm.Name
    33TMAINFORM.LABEL1.CAPTION=MainForm
  • trunk/Components/CoolTranslator/Demo/UMainForm.pas

    r29 r30  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    9   UCoolTranslator;
     9  UCoolTranslator, ULanguages;
    1010
    1111type
  • trunk/Components/CoolTranslator/UCoolTranslator.pas

    r29 r30  
    1010
    1111type
     12  THandleStringEvent = function (AValue: string): string of object;
     13
    1214  { TComponentExcludes }
    1315
     
    3133  private
    3234    FLanguage: TLanguage;
     35    FOnAutomaticLanguage: THandleStringEvent;
    3336    FOnTranslate: TNotifyEvent;
    3437    FPOFilesFolder: string;
     
    4043    procedure ReloadFiles;
    4144    procedure SetPOFilesFolder(const AValue: string);
    42     procedure Translate;
    4345    procedure SetLanguage(const AValue: TLanguage);
    4446    procedure TranslateProperty(Component: TPersistent; PropInfo: PPropInfo);
     
    4749    ComponentExcludes: TComponentExcludesList;
    4850    Languages: TLanguageList;
     51    procedure Translate;
    4952    procedure LanguageListToStrings(Strings: TStrings);
    5053    procedure TranslateResourceStrings(PoFileName: string);
     
    6164    property Language: TLanguage read FLanguage write SetLanguage;
    6265    property OnTranslate: TNotifyEvent read FOnTranslate write FOnTranslate;
     66    property OnAutomaticLanguage: THandleStringEvent read FOnAutomaticLanguage
     67      write FOnAutomaticLanguage;
    6368  end;
    6469
     
    131136      for J := 0 to Items.Count - 1 do
    132137      with TPoFileItem(Items[J]) do
    133         Po.Add(Identifier, Original, Translation, Comments, Context,
     138        Po.Add(IdentifierLow, Original, Translation, Comments, Context,
    134139          Flags, PreviousID);
    135140    Translations.TranslateResourceStrings(Po);
     
    152157    //ShowMessage(ExtractFileDir(Application.ExeName) +
    153158    //  DirectorySeparator + 'Languages' + ' ' + '*.' + LocaleShort + '.po');
    154     FileList := FindAllFiles(ExtractFileDir(Application.ExeName) +
    155       DirectorySeparator + 'Languages', '*.' + LocaleShort + '.po');
     159    FileList := FindAllFiles(ExtractFileDir(UTF8Encode(Application.ExeName)) +
     160      DirectorySeparator + FPOFilesFolder, '*.' + LocaleShort + '.po');
    156161    for I := 0 to FileList.Count - 1 do begin
    157162      FileName := FileList[I];
     
    393398    LCLGetLanguageIDs(Lang, T);
    394399
     400  if Assigned(Language) and (Language.Code = '') and Assigned(FOnAutomaticLanguage) then begin
     401    Lang := FOnAutomaticLanguage(Lang);
     402  end;
     403
    395404  if Lang = 'en' then Lang := ''; // English files are without en code
     405
    396406  Result := Lang;
    397407end;
Note: See TracChangeset for help on using the changeset viewer.