Changeset 526 for CoolTranslator
- Timestamp:
- May 6, 2019, 10:05:59 AM (6 years ago)
- Location:
- CoolTranslator
- Files:
-
- 1 added
- 1 deleted
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
CoolTranslator/CoolTranslator.lpk
r269 r526 1 <?xml version="1.0" ?>1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <CONFIG> 3 3 <Package Version="4"> 4 4 <PathDelim Value="\"/> 5 5 <Name Value="CoolTranslator"/> 6 <Type Value="RunAndDesignTime"/> 6 7 <AddToProjectUsesSection Value="True"/> 7 8 <Author Value="Chronos (robie@centrum.cz)"/> 8 9 <CompilerOptions> 9 <Version Value="1 0"/>10 <Version Value="11"/> 10 11 <PathDelim Value="\"/> 11 12 <SearchPaths> 12 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS) "/>13 <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 13 14 </SearchPaths> 15 <Parsing> 16 <SyntaxOptions> 17 <SyntaxMode Value="Delphi"/> 18 <CStyleOperator Value="False"/> 19 <AllowLabel Value="False"/> 20 <CPPInline Value="False"/> 21 </SyntaxOptions> 22 </Parsing> 23 <CodeGeneration> 24 <Optimizations> 25 <OptimizationLevel Value="0"/> 26 </Optimizations> 27 </CodeGeneration> 28 <Linking> 29 <Debugging> 30 <GenerateDebugInfo Value="False"/> 31 </Debugging> 32 </Linking> 14 33 <Other> 15 <CompilerPath Value="$(CompPath)"/> 34 <CompilerMessages> 35 <IgnoredMessages idx5024="True"/> 36 </CompilerMessages> 16 37 </Other> 17 38 </CompilerOptions> … … 38 59 <OutDir Value="Languages"/> 39 60 </i18n> 40 <Type Value="RunAndDesignTime"/>41 61 <RequiredPkgs Count="2"> 42 62 <Item1> -
CoolTranslator/Demo/Languages/TranslatorDemo.cs.po
r457 r526 9 9 "MIME-Version: 1.0\n" 10 10 "Content-Transfer-Encoding: 8bit\n" 11 12 #: tform1.form1.caption13 msgctxt "TFORM1.FORM1.CAPTION"14 msgid "Translator Demo"15 msgstr "Ukázka Translatoru"16 11 17 12 #: tmainform.button1.caption -
CoolTranslator/Demo/Languages/TranslatorDemo.de.po
r457 r526 1 1 msgid "" 2 2 msgstr "Content-Type: text/plain; charset=UTF-8" 3 4 #: tform1.form1.caption5 msgctxt "TFORM1.FORM1.CAPTION"6 msgid "Translator Demo"7 msgstr ""8 3 9 4 #: tmainform.button1.caption -
CoolTranslator/Demo/Languages/TranslatorDemo.po
r457 r526 1 1 msgid "" 2 2 msgstr "Content-Type: text/plain; charset=UTF-8" 3 4 #: tform1.form1.caption5 msgctxt "TFORM1.FORM1.CAPTION"6 msgid "Translator Demo"7 msgstr ""8 3 9 4 #: tmainform.button1.caption -
CoolTranslator/Demo/UMainForm.lfm
r457 r526 1 1 object MainForm: TMainForm 2 2 Left = 406 3 Height = 2403 Height = 300 4 4 Top = 191 5 Width = 4665 Width = 582 6 6 Caption = 'Translator Demo' 7 ClientHeight = 240 8 ClientWidth = 466 7 ClientHeight = 300 8 ClientWidth = 582 9 DesignTimePPI = 120 9 10 OnCreate = FormCreate 10 LCLVersion = ' 1.1'11 LCLVersion = '2.0.2.0' 11 12 object ListBox1: TListBox 12 Left = 17113 Height = 16814 Top = 2415 Width = 1 4113 Left = 214 14 Height = 210 15 Top = 30 16 Width = 176 16 17 ItemHeight = 0 17 18 OnSelectionChange = ListBox1SelectionChange 19 ParentFont = False 18 20 TabOrder = 0 19 21 end 20 22 object Button1: TButton 21 Left = 822 Height = 2523 Top = 2 0824 Width = 1 2823 Left = 10 24 Height = 31 25 Top = 260 26 Width = 160 25 27 Caption = 'Show MainForm.Name' 26 28 OnClick = Button1Click 29 ParentFont = False 27 30 TabOrder = 1 28 31 end 29 32 object Label1: TLabel 30 Left = 1 031 Height = 1332 Top = 2433 Width = 4633 Left = 12 34 Height = 20 35 Top = 30 36 Width = 67 34 37 Caption = 'MainForm' 35 38 ParentColor = False 39 ParentFont = False 36 40 end 37 41 object Label2: TLabel 38 Left = 1 039 Height = 1340 Top = 641 Width = 1 3442 Left = 12 43 Height = 20 44 Top = 8 45 Width = 187 42 46 Caption = 'Form name as label caption:' 43 47 ParentColor = False 48 ParentFont = False 44 49 end 45 50 object Label3: TLabel 46 Left = 17147 Height = 1348 Top = 849 Width = 6751 Left = 214 52 Height = 20 53 Top = 10 54 Width = 91 50 55 Caption = 'Language list:' 51 56 ParentColor = False 57 ParentFont = False 52 58 end 53 59 object ListBox2: TListBox 54 Left = 32155 Height = 16856 Top = 2457 Width = 1 3560 Left = 401 61 Height = 210 62 Top = 30 63 Width = 169 58 64 ItemHeight = 0 65 ParentFont = False 59 66 TabOrder = 2 60 67 end 61 68 object Label4: TLabel 62 Left = 32163 Height = 1364 Top = 1 065 Width = 4669 Left = 401 70 Height = 20 71 Top = 12 72 Width = 60 66 73 Caption = 'Excludes:' 67 74 ParentColor = False 75 ParentFont = False 68 76 end 69 77 object CoolTranslator1: TCoolTranslator 70 78 POFilesFolder = 'Languages' 71 79 left = 72 72 top = 7280 top = 90 73 81 end 74 82 end -
CoolTranslator/UCoolTranslator.pas
r495 r526 127 127 I, J: Integer; 128 128 Po: TPoFile; 129 Item: TPOFileItem; 129 130 begin 130 131 TranslateComponentRecursive(Application); … … 136 137 with TPoFile(FPoFiles[I]) do 137 138 for J := 0 to Items.Count - 1 do 138 with TPoFileItem(Items[J]) do 139 Po.Add(IdentifierLow, Original, Translation, Comments, Context, 139 with TPoFileItem(Items[J]) do begin 140 Item := nil; 141 Po.FillItem(Item, IdentifierLow, Original, Translation, Comments, Context, 140 142 Flags, PreviousID); 143 end; 141 144 Translations.TranslateResourceStrings(Po); 142 145 finally … … 197 200 PropInfo: PPropInfo; 198 201 PropList: PPropList; 199 Excludes: TComponentExcludes;200 202 begin 201 203 Count := GetTypeData(Component.ClassInfo)^.PropCount; … … 250 252 if (UpperCase(PropType.Name) = 'TTRANSLATESTRING') then 251 253 //if not IsExcluded(Component, PropInfo^.Name) then 252 SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, GetWideStrProp(Component, PropInfo)));254 SetStrProp(Component, PropInfo, TranslateText(PropInfo^.Name, string(GetWideStrProp(Component, PropInfo)))); 253 255 end; 254 256 tkClass: begin … … 295 297 Result := FPOFilesFolder; 296 298 if Copy(Result, 1, 1) <> DirectorySeparator then 297 Result := ExtractFileDir( UTF8Encode(Application.ExeName)) +299 Result := ExtractFileDir(Application.ExeName) + 298 300 DirectorySeparator + Result; 299 301 end; … … 412 414 Lang := ParamStr(i + 1); 413 415 end; 414 if Lang = '' then 416 if Lang = '' then begin 417 T := ''; 415 418 LazGetLanguageIDs(Lang, T); 419 end; 416 420 417 421 if Assigned(Language) and (Language.Code = '') and Assigned(FOnAutomaticLanguage) then begin … … 429 433 function TCoolTranslator.FindLocaleFileName(LCExt: string): string; 430 434 var 431 T: string;432 435 Lang: string; 433 436 begin
Note:
See TracChangeset
for help on using the changeset viewer.