From 15b0fa58cc06f1cb25da6f2ddc9f17113eedb71c Mon Sep 17 00:00:00 2001 From: Dart Raiden Date: Fri, 27 Dec 2013 07:35:46 +0000 Subject: langpacks/belarusian: update (from Jerbifor) replacer is now combined with langpackmgr git-svn-id: http://svn.miranda-ng.org/main/trunk@7386 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- tools/langpackmgr/Unit1.pas | 150 ++++++++++++++++++++++++++++++++------ tools/langpackmgr/langpackmgr.lps | 70 +++++++++--------- tools/langpackmgr/unit1.lfm | 46 ++++++++++++ tools/replacer/replacer.ico | Bin 15086 -> 0 bytes tools/replacer/replacer.lpi | 91 ----------------------- tools/replacer/replacer.lpr | 21 ------ tools/replacer/replacer.lps | 39 ---------- tools/replacer/unit1.lfm | 52 ------------- tools/replacer/unit1.pas | 143 ------------------------------------ 9 files changed, 208 insertions(+), 404 deletions(-) delete mode 100644 tools/replacer/replacer.ico delete mode 100644 tools/replacer/replacer.lpi delete mode 100644 tools/replacer/replacer.lpr delete mode 100644 tools/replacer/replacer.lps delete mode 100644 tools/replacer/unit1.lfm delete mode 100644 tools/replacer/unit1.pas (limited to 'tools') diff --git a/tools/langpackmgr/Unit1.pas b/tools/langpackmgr/Unit1.pas index e708bbbee3..eab1fdc20e 100644 --- a/tools/langpackmgr/Unit1.pas +++ b/tools/langpackmgr/Unit1.pas @@ -4,7 +4,7 @@ interface uses classes, sysutils, fileutil, forms, controls, graphics, dialogs, stdctrls, - extctrls, Windows; + extctrls, CheckLst, Windows; type @@ -15,6 +15,11 @@ type button2: tbutton; button3: tbutton; button4: tbutton; + Button5: TButton; + Button6: TButton; + CheckListBox1: TCheckListBox; + Edit1: TEdit; + Edit2: TEdit; Label1: TLabel; memo1: tmemo; memo2: tmemo; @@ -26,6 +31,8 @@ type procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); + procedure Button5Click(Sender: TObject); + procedure Button6Click(Sender: TObject); procedure combobox1change(sender: tobject); procedure ComboBox2Change(Sender: TObject); procedure formcreate(sender: tobject); @@ -68,29 +75,44 @@ begin view:='english'; trlang:=TstringList.Create; trline:=TstringList.Create; - if (paramstr(1)='-r') then - begin - form1.caption:='Miranda NG Langpack Tools: Replacer'; - end - else - begin - res:=findfirst(extractfilepath(application.exename)+'*',faanyfile,sr); - while res = 0 do - begin - if ((sr.attr and fadirectory)=fadirectory) - and ((sr.name='.')or(sr.name='..')) then +begin + res:=findfirst(extractfilepath(application.exename)+'*',faanyfile,sr); + while res = 0 do + begin + if ((sr.attr and fadirectory)=fadirectory) + and ((sr.name='.')or(sr.name='..')) then begin res:=findnext(sr); continue; end; - if ((sr.attr and fadirectory)=fadirectory) - and (fileexists(extractfilepath(application.exename)+ - '/'+sr.name+'/=head=.txt')) and (sr.name<>'english') then - begin - ListBox.items.add(sr.name); - trlang.add(sr.name); - end; - res:=findnext(sr); - end; - SysUtils.FindClose(sr); + if ((sr.attr and fadirectory)=fadirectory) + and (fileexists(extractfilepath(application.exename)+ + '/'+sr.name+'/=head=.txt')) and (sr.name<>'english') then + begin + ListBox.items.add(sr.name); + trlang.add(sr.name); + end; + res:=findnext(sr); + end; + SysUtils.FindClose(sr); + end; + if (paramstr(1)='-r') then + begin + form1.caption:='Miranda NG Langpack Tools: Replacer'; + listbox.visible:=false; + memo1.Visible:=false; + memo2.Visible:=false; + combobox1.visible:=false; + combobox2.visible:=false; + button1.visible:=false; + button2.visible:=false; + button3.visible:=false; + button4.visible:=false; + label1.visible:=false; + radiogroup1.visible:=false; + edit1.visible:=true; + edit2.visible:=true; + button5.visible:=true; + button6.visible:=true; + checklistbox1.visible:=true; end; end; @@ -111,6 +133,14 @@ begin memo1.Height:=Trunc((form1.Height-80)/2); memo2.Height:=Trunc((form1.Height-80)/2); memo2.top:=44+memo1.Height; + + edit1.width:=form1.width-105; + edit2.width:=form1.width-105; + button5.left:=form1.width-88; + button6.left:=form1.width-88; + checklistbox1.width:=form1.width-12; + checklistbox1.height:=form1.height-68; + end; procedure tform1.stringlist; @@ -315,6 +345,82 @@ procedure tform1.Button4Click(Sender: TObject); ShellExecute(0, 'open',PChar(str), nil, nil, SW_SHOW); end; +procedure tform1.Button5Click(Sender: TObject); +begin + CheckListBox1.Items.clear; + for i := 0 to trlang.Count-1 do +begin + trline:=TstringList.Create; + if fileexists(extractfilepath(application.exename) + +trlang[i]+'/'+'=CORE=.txt') then + begin + trline.LoadFromFile(extractfilepath(application.exename) + +trlang[i]+'/'+'=CORE=.txt'); + for j := 0 to trline.count-1 do + if trline[j]=edit1.text then + begin + CheckListBox1.Items.Add(trlang[i]+'/'+'=CORE=.txt'); + break; + end; + end; + trline.Free; + + res:=FindFirst(ExtractFilePath(Application.ExeName)+'/' ++trlang[i]+'/plugins/*.txt', faAnyFile, sr); + while res = 0 do + begin + trline:=TstringList.Create; + trline.LoadFromFile(extractfilepath(application.exename) + +'/'+trlang[i]+'/'+'plugins/'+sr.name); + for j := 0 to trline.count-1 do + if trline[j]=edit1.text then + begin + CheckListBox1.Items.Add(trlang[i]+'/'+'plugins/'+sr.name); + break; + end; + trline.free; + res:=FindNext(sr); + end; + FindClose(res); + +res:=FindFirst(ExtractFilePath(Application.ExeName)+'/' ++trlang[i]+'/weather/*.txt', faAnyFile, sr); + while res = 0 do + begin + trline:=TstringList.Create; + trline.LoadFromFile(extractfilepath(application.exename) + +'/'+trlang[i]+'/'+'weather/'+sr.name); + for j := 0 to trline.count-1 do + if trline[j]=edit1.text then + begin + CheckListBox1.Items.Add(trlang[i]+'/'+'plugins/'+sr.name); + break; + end; + trline.free; + res:=FindNext(sr); + end; + FindClose(res); + +end; +for i := 0 to CheckListBox1.Count-1 do + CheckListBox1.Checked[i]:=true; +end; + +procedure tform1.Button6Click(Sender: TObject); +begin + for i := 0 to CheckListBox1.Count-1 do + if CheckListBox1.Checked[i]=true then + begin + trline:=TstringList.Create; + trline.LoadFromFile(extractfilepath(application.exename) + +'/'+CheckListBox1.Items[i]); + for j := 1 to trline.Count-1 do + if trline[j]=edit1.text then trline[j]:=edit2.text; + trline.SaveToFile(extractfilepath(application.exename) + +'/'+CheckListBox1.Items[i]); + end; +end; + procedure tform1.ListBox1Click(sender: tobject); var search:TStringList; r:integer; begin diff --git a/tools/langpackmgr/langpackmgr.lps b/tools/langpackmgr/langpackmgr.lps index d130412174..5b9036e12f 100644 --- a/tools/langpackmgr/langpackmgr.lps +++ b/tools/langpackmgr/langpackmgr.lps @@ -13,7 +13,7 @@ - + @@ -26,9 +26,9 @@ - - - + + + @@ -50,12 +50,10 @@ - - @@ -64,123 +62,123 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/tools/langpackmgr/unit1.lfm b/tools/langpackmgr/unit1.lfm index ae62917e23..76c8ce4d9a 100644 --- a/tools/langpackmgr/unit1.lfm +++ b/tools/langpackmgr/unit1.lfm @@ -138,4 +138,50 @@ object Form1: TForm1 Caption = 'Other langs:' ParentColor = False end + object Edit1: TEdit + Left = 8 + Height = 21 + Top = 8 + Width = 400 + TabOrder = 10 + Visible = False + end + object Edit2: TEdit + Left = 8 + Height = 21 + Top = 36 + Width = 400 + TabOrder = 11 + Visible = False + end + object Button5: TButton + Left = 416 + Height = 21 + Top = 8 + Width = 83 + Caption = 'Find' + OnClick = Button5Click + TabOrder = 12 + Visible = False + end + object Button6: TButton + Left = 416 + Height = 21 + Top = 36 + Width = 83 + Caption = 'Replace' + OnClick = Button6Click + TabOrder = 13 + Visible = False + end + object CheckListBox1: TCheckListBox + Left = 8 + Height = 272 + Top = 64 + Width = 491 + Columns = 2 + ItemHeight = 0 + TabOrder = 14 + Visible = False + end end diff --git a/tools/replacer/replacer.ico b/tools/replacer/replacer.ico deleted file mode 100644 index e5fe684d9c..0000000000 Binary files a/tools/replacer/replacer.ico and /dev/null differ diff --git a/tools/replacer/replacer.lpi b/tools/replacer/replacer.lpi deleted file mode 100644 index 4441bbc3e7..0000000000 --- a/tools/replacer/replacer.lpi +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - <ResourceType Value="res"/> - <UseXPManifest Value="True"/> - <Icon Value="0"/> - </General> - <i18n> - <EnableI18N LFM="False"/> - </i18n> - <VersionInfo> - <StringTable ProductVersion=""/> - </VersionInfo> - <BuildModes Count="1"> - <Item1 Name="Default" Default="True"/> - </BuildModes> - <PublishOptions> - <Version Value="2"/> - <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> - <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/> - </PublishOptions> - <RunParams> - <local> - <FormatVersion Value="1"/> - </local> - </RunParams> - <RequiredPackages Count="1"> - <Item1> - <PackageName Value="LCL"/> - </Item1> - </RequiredPackages> - <Units Count="2"> - <Unit0> - <Filename Value="replacer.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="replacer"/> - </Unit0> - <Unit1> - <Filename Value="unit1.pas"/> - <IsPartOfProject Value="True"/> - <ComponentName Value="Form1"/> - <HasResources Value="True"/> - <ResourceBaseClass Value="Form"/> - <UnitName Value="Unit1"/> - </Unit1> - </Units> - </ProjectOptions> - <CompilerOptions> - <Version Value="11"/> - <PathDelim Value="\"/> - <Target> - <Filename Value="replacer"/> - </Target> - <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)"/> - <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> - </SearchPaths> - <Linking> - <Options> - <Win32> - <GraphicApplication Value="True"/> - </Win32> - </Options> - </Linking> - <Other> - <CompilerMessages> - <MsgFileName Value=""/> - </CompilerMessages> - <CompilerPath Value="$(CompPath)"/> - </Other> - </CompilerOptions> - <Debugging> - <Exceptions Count="3"> - <Item1> - <Name Value="EAbort"/> - </Item1> - <Item2> - <Name Value="ECodetoolError"/> - </Item2> - <Item3> - <Name Value="EFOpenError"/> - </Item3> - </Exceptions> - </Debugging> -</CONFIG> diff --git a/tools/replacer/replacer.lpr b/tools/replacer/replacer.lpr deleted file mode 100644 index f81d096866..0000000000 --- a/tools/replacer/replacer.lpr +++ /dev/null @@ -1,21 +0,0 @@ -program replacer; - -{$mode objfpc}{$H+} - -uses - {$IFDEF UNIX}{$IFDEF UseCThreads} - cthreads, - {$ENDIF}{$ENDIF} - Interfaces, // this includes the LCL widgetset - Forms, Unit1 - { you can add units after this }; - -{$R *.res} - -begin - RequireDerivedFormResource := True; - Application.Initialize; - Application.CreateForm(TForm1, Form1); - Application.Run; -end. - diff --git a/tools/replacer/replacer.lps b/tools/replacer/replacer.lps deleted file mode 100644 index 4a32f93491..0000000000 --- a/tools/replacer/replacer.lps +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0"?> -<CONFIG> - <ProjectSession> - <PathDelim Value="\"/> - <Version Value="9"/> - <BuildModes Active="Default"/> - <Units Count="2"> - <Unit0> - <Filename Value="replacer.lpr"/> - <IsPartOfProject Value="True"/> - <UnitName Value="replacer"/> - <WindowIndex Value="0"/> - <TopLine Value="1"/> - <CursorPos X="1" Y="1"/> - <UsageCount Value="22"/> - </Unit0> - <Unit1> - <Filename Value="unit1.pas"/> - <IsPartOfProject Value="True"/> - <ComponentName Value="Form1"/> - <HasResources Value="True"/> - <ResourceBaseClass Value="Form"/> - <UnitName Value="Unit1"/> - <IsVisibleTab Value="True"/> - <EditorIndex Value="0"/> - <WindowIndex Value="0"/> - <TopLine Value="69"/> - <CursorPos X="26" Y="80"/> - <UsageCount Value="22"/> - <Loaded Value="True"/> - <LoadedDesigner Value="True"/> - </Unit1> - </Units> - <General> - <ActiveWindowIndexAtStart Value="0"/> - </General> - <JumpHistory Count="0" HistoryIndex="-1"/> - </ProjectSession> -</CONFIG> diff --git a/tools/replacer/unit1.lfm b/tools/replacer/unit1.lfm deleted file mode 100644 index a260da370d..0000000000 --- a/tools/replacer/unit1.lfm +++ /dev/null @@ -1,52 +0,0 @@ -object Form1: TForm1 - Left = 292 - Height = 275 - Top = 156 - Width = 361 - BorderIcons = [biSystemMenu] - BorderStyle = bsDialog - Caption = 'Miranda NG Langpack Tools: Replacer' - ClientHeight = 275 - ClientWidth = 361 - LCLVersion = '1.0.14.0' - object CheckListBox1: TCheckListBox - Left = 8 - Height = 208 - Top = 64 - Width = 347 - ItemHeight = 0 - TabOrder = 0 - end - object Edit1: TEdit - Left = 8 - Height = 21 - Top = 8 - Width = 280 - TabOrder = 1 - end - object Button1: TButton - Left = 296 - Height = 21 - Top = 8 - Width = 59 - Caption = 'Find' - OnClick = Button1Click - TabOrder = 2 - end - object Edit2: TEdit - Left = 8 - Height = 21 - Top = 36 - Width = 280 - TabOrder = 3 - end - object Button2: TButton - Left = 296 - Height = 21 - Top = 36 - Width = 59 - Caption = 'Replace' - OnClick = Button2Click - TabOrder = 4 - end -end diff --git a/tools/replacer/unit1.pas b/tools/replacer/unit1.pas deleted file mode 100644 index b6a66bed0c..0000000000 --- a/tools/replacer/unit1.pas +++ /dev/null @@ -1,143 +0,0 @@ -unit Unit1; - - - -interface - -uses - Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, - CheckLst; -{ IMAGE_FILE_LINE_NUMS_STRIPPED or IMAGE_FILE_LOCAL_SYMS_STRIPPED - $WEAKLINKRTTI ON $RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([]) } -type - - { TForm1 } - - TForm1 = class(TForm) - Button1: TButton; - Button2: TButton; - CheckListBox1: TCheckListBox; - Edit1: TEdit; - Edit2: TEdit; - procedure Button1Click(Sender: TObject); - procedure Button2Click(Sender: TObject); - - private - { private declarations } - public - { public declarations } - end; - -var - - Form1: TForm1; - d:tsearchrec; - a:TStringList; - langs:TStringList; - i,j:integer; - s:string; - r,t:integer; - -implementation - -{$R *.lfm} - -{ TForm1 } - -procedure TForm1.Button1Click(Sender: TObject); -begin - CheckListBox1.Items.clear; - langs:=TstringList.Create; - r:=findfirst(extractfilePath(application.exename)+'*',faanyfile,d); - while r = 0 do - begin - if ((d.attr and fadirectory)=fadirectory) - and ((d.name='.')or(d.name='..')) then - begin r:=findnext(d); continue; end; - if ((d.attr and fadirectory)=fadirectory) - and (fileexists(extractfilepath(application.exename)+ - '/'+d.name+'/=HEAD=.txt')) then - begin - langs.Add(d.name); - end; - r:=FindNext(d); - end; -FindClose(d); - - -for i := 0 to langs.Count-1 do -begin - a:=TstringList.Create; - if fileexists(extractfilepath(application.exename)+langs[i]+'/'+'=CORE=.txt') then - begin - a.LoadFromFile(extractfilepath(application.exename)+langs[i]+'/'+'=CORE=.txt'); - for j := 0 to a.count-1 do - if a[j]=edit1.text then - begin - CheckListBox1.Items.Add(langs[i]+'/'+'=CORE=.txt'); - break; - end; - - end; - a.Free; - - r:=FindFirst(ExtractFilePath(Application.ExeName)+'/' -+langs[i]+'/plugins/*.txt', faAnyFile, d); - while r = 0 do - begin - a:=TstringList.Create; - a.LoadFromFile(extractfilepath(application.exename) - +'/'+langs[i]+'/'+'plugins/'+d.name); - for j := 0 to a.count-1 do - if a[j]=edit1.text then - begin - CheckListBox1.Items.Add(langs[i]+'/'+'plugins/'+d.name); - break; - end; - a.free; - r:=FindNext(d); - end; - FindClose(d); - -r:=FindFirst(ExtractFilePath(Application.ExeName)+'/' -+langs[i]+'/weather/*.txt', faAnyFile, d); - while r = 0 do - begin - a:=TstringList.Create; - a.LoadFromFile(extractfilepath(application.exename) - +'/'+langs[i]+'/'+'weather/'+d.name); - for j := 0 to a.count-1 do - if a[j]=edit1.text then - begin - CheckListBox1.Items.Add(langs[i]+'/'+'plugins/'+d.name); - break; - end; - a.free; - r:=FindNext(d); - end; - FindClose(d); - -end; - -for i := 0 to CheckListBox1.Count-1 do - CheckListBox1.Checked[i]:=true; - -end; - -procedure TForm1.Button2Click(Sender: TObject); -begin - for i := 0 to CheckListBox1.Count-1 do - if CheckListBox1.Checked[i]=true then - begin - a:=TstringList.Create; - a.LoadFromFile(extractfilepath(application.exename) - +'/'+CheckListBox1.Items[i]); - for j := 1 to a.Count-1 do - if a[j]=edit1.text then a[j]:=edit2.text; - a.SaveToFile(extractfilepath(application.exename) - +'/'+CheckListBox1.Items[i]); - end; -end; - -end. - -- cgit v1.2.3