Changeset 228 for CoolTranslator/UCoolTranslator.pas
- Timestamp:
- Apr 7, 2011, 8:05:17 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolTranslator/UCoolTranslator.pas
r226 r228 7 7 uses 8 8 Classes, SysUtils, Forms, StdCtrls, ExtCtrls, StrUtils, Controls, Contnrs, 9 Translations, TypInfo, Dialogs, FileUtil, LCLProc ;9 Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages; 10 10 11 11 type 12 13 TLanguage = class14 Name: string;15 Code: string;16 end;17 18 { TLanguageList }19 20 TLanguageList = class(TObjectList)21 function SearchByCode(ACode: string): TLanguage;22 end;23 24 12 { TComponentExcludes } 25 13 … … 74 62 procedure Register; 75 63 76 resourcestring77 SLanguageCzech = 'Czech';78 SLanguageEnglish = 'English';79 SLanguageAutomatic = 'Automatic';80 81 82 64 implementation 83 65 … … 308 290 inherited; 309 291 ComponentExcludes := TComponentExcludesList.Create; 292 Languages := TLanguageList.Create; 293 POFilesFolder := 'Languages'; 294 295 // LCL 310 296 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'); 325 299 end; 326 300 … … 476 450 end; 477 451 478 { TLanguageList }479 480 function TLanguageList.SearchByCode(ACode: string): TLanguage;481 var482 I: Integer;483 begin484 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 490 452 491 453 end.
Note:
See TracChangeset
for help on using the changeset viewer.