Changeset 228 for CoolTranslator
- Timestamp:
- Apr 7, 2011, 8:05:17 AM (14 years ago)
- Location:
- CoolTranslator
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolTranslator/CoolTranslator.lpk
r226 r228 9 9 <PathDelim Value="\"/> 10 10 <SearchPaths> 11 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS) \"/>11 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> 12 12 </SearchPaths> 13 13 <Other> … … 18 18 <License Value="GNU/GPL"/> 19 19 <Version Minor="1"/> 20 <Files Count=" 1">20 <Files Count="2"> 21 21 <Item1> 22 22 <Filename Value="UCoolTranslator.pas"/> … … 24 24 <UnitName Value="UCoolTranslator"/> 25 25 </Item1> 26 <Item2> 27 <Filename Value="ULanguages.pas"/> 28 <UnitName Value="ULanguages"/> 29 </Item2> 26 30 </Files> 31 <i18n> 32 <EnableI18N Value="True"/> 33 <OutDir Value="Languages"/> 34 </i18n> 27 35 <Type Value="RunAndDesignTime"/> 28 36 <RequiredPkgs Count="2"> -
CoolTranslator/CoolTranslator.pas
r226 r228 8 8 9 9 uses 10 UCoolTranslator, LazarusPackageIntf;10 UCoolTranslator, ULanguages, LazarusPackageIntf; 11 11 12 12 implementation -
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.