Ignore:
Timestamp:
Apr 7, 2011, 8:05:17 AM (14 years ago)
Author:
george
Message:
  • Added: Language list of all languages with their codes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • CoolTranslator/UCoolTranslator.pas

    r226 r228  
    77uses
    88  Classes, SysUtils, Forms, StdCtrls, ExtCtrls, StrUtils, Controls, Contnrs,
    9   Translations, TypInfo, Dialogs, FileUtil, LCLProc;
     9  Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages;
    1010
    1111type
    12 
    13   TLanguage = class
    14     Name: string;
    15     Code: string;
    16   end;
    17 
    18   { TLanguageList }
    19 
    20   TLanguageList = class(TObjectList)
    21     function SearchByCode(ACode: string): TLanguage;
    22   end;
    23 
    2412  { TComponentExcludes }
    2513
     
    7462procedure Register;
    7563
    76 resourcestring
    77   SLanguageCzech = 'Czech';
    78   SLanguageEnglish = 'English';
    79   SLanguageAutomatic = 'Automatic';
    80 
    81 
    8264implementation
    8365
     
    308290  inherited;
    309291  ComponentExcludes := TComponentExcludesList.Create;
     292  Languages := TLanguageList.Create;
     293  POFilesFolder := 'Languages';
     294
     295  // LCL
    310296  AddExcludes(TComponent, 'Name');
    311 
    312   Languages := TLanguageList.Create;
    313   with TLanguage(Languages[Languages.Add(TLanguage.Create)]) do begin
    314     Name := SLanguageAutomatic;
    315     Code := '';
    316   end;
    317   with TLanguage(Languages[Languages.Add(TLanguage.Create)]) do begin
    318     Name := SLanguageCzech;
    319     Code := 'cs';
    320   end;
    321   with TLanguage(Languages[Languages.Add(TLanguage.Create)]) do begin
    322     Name := SLanguageEnglish;
    323     Code := 'en';
    324   end;
     297  //AddExcludes(TAction, 'Category');
     298  AddExcludes(TControl, 'HelpKeyword');
    325299end;
    326300
     
    476450end;
    477451
    478 { TLanguageList }
    479 
    480 function TLanguageList.SearchByCode(ACode: string): TLanguage;
    481 var
    482   I: Integer;
    483 begin
    484   I := 0;
    485   while (I < Count) and (TLanguage(Items[I]).Code < ACode) do Inc(I);
    486   if I < Count then Result := TLanguage(Items[I])
    487     else Result := nil;
    488 end;
    489 
    490452
    491453end.
Note: See TracChangeset for help on using the changeset viewer.