Hi,

Attached is a patch that must be applied from the root Lazarus
directory.  After this patch the localize scripts need to be run, to
update all the .po files.

Changes:
---------------
 *  Removed a lot of duplicate resource strings throughout the IDE.
A lot more to follow shortly!

 *  Added support for a new language. Afrikaans - South Africa.  The
*.af_ZA.po files will follow over the weekend. Until then, don't
worry, Lazarus doesn't crash due to the missing .po files, it defaults
to English in such a case (10 out of 10 to those clever Lazarus
developers).  :-)

* Fixed the "Procedure List" dialog.  It didn't translate at all and
some captions where hard coded.  New resource strings have been added
for those.


Regards,
 - Graeme -



--
There's no place like 127.0.0.1
Index: ide/idetranslations.pas
===================================================================
--- ide/idetranslations.pas	(revision 9954)
+++ ide/idetranslations.pas	(working copy)
@@ -121,6 +121,8 @@
     Result:=rsLanguageChinese
   else if CompareText(ID,'id')=0 then
     Result:=rsLanguageIndonesian
+  else if CompareText(ID,'af_ZA')=0 then
+    Result:=rsLanguageAfrikaans
   else
     Result:=ID;
 end;
Index: ide/mainbase.pas
===================================================================
--- ide/mainbase.pas	(revision 9954)
+++ ide/mainbase.pas	(working copy)
@@ -323,7 +323,7 @@
     CreateMenuSeparatorSection(mnuFile,itmFileOpenSave,'itmFileOpenSave');
     ParentMI:=itmFileOpenSave;
 
-    CreateMenuItem(ParentMI, itmFileOpen, 'itmFileOpen', lisOpen, 'menu_open');
+    CreateMenuItem(ParentMI, itmFileOpen, 'itmFileOpen', lisMenuOpen, 'menu_open');
     CreateMenuItem(ParentMI,itmFileRevert,'itmFileRevert',lisMenuRevert,'menu_undo');
     CreateMenuSubSection(ParentMI,itmFileRecentOpen,'itmFileRecentOpen',lisMenuOpenRecent);
     CreateMenuItem(ParentMI,itmFileSave,'itmFileSave',lisMenuSave,'menu_save');
@@ -738,7 +738,7 @@
     ParentMI:=itmInfoHelps;
 
     CreateMenuItem(ParentMI,itmHelpAboutLazarus,'itmHelpAboutLazarus',
-                   lisMenuAboutLazarus);
+                   lisAboutLazarus);
   end;
 end;
 
Index: ide/keymapping.pp
===================================================================
--- ide/keymapping.pp	(revision 9954)
+++ ide/keymapping.pp	(working copy)
@@ -1246,16 +1246,16 @@
     ecGotoEditor0            : Result:= Format(srkmecGotoEditor,[cmd-ecGotoEditor1]);
 
     // file menu
-    ecNew                    : Result:= srkmecNew;
-    ecNewUnit                : Result:= srkmecNewUnit;
-    ecNewForm                : Result:= srkmecNewForm;
+    ecNew                    : Result:= lisMenuNewOther;
+    ecNewUnit                : Result:= lisMenuNewUnit;
+    ecNewForm                : Result:= lisMenuNewForm;
     ecOpen                   : Result:= lisMenuOpen;
     ecRevert                 : Result:= lisMenuRevert;
     ecSave                   : Result:= lisMenuSave;
-    ecSaveAs                 : Result:= srkmecSaveAs;
-    ecSaveAll                : Result:= srkmecSaveAll;
-    ecClose                  : Result:= lismenuclose;
-    ecCloseAll               : Result:= srkmecCloseAll;
+    ecSaveAs                 : Result:= lisMenuSaveAs;
+    ecSaveAll                : Result:= lisMenuSaveAll;
+    ecClose                  : Result:= lisMenuClose;
+    ecCloseAll               : Result:= lisMenuCloseAll;
     ecCleanDirectory         : Result:= lisMenuCleanDirectory;
     ecRestart                : Result:= lisMenuRestart;
     ecQuit                   : Result:= lisMenuQuit;
@@ -1415,7 +1415,7 @@
     ecRescanFPCSrcDir        : Result:= lisMenuRescanFPCSourceDirectory;
 
     // help menu
-    ecAboutLazarus           : Result:= lisMenuAboutLazarus;
+    ecAboutLazarus           : Result:= lisAboutLazarus;
     ecOnlineHelp             : Result:= lisMenuOnlineHelp;
     ecConfigureHelp          : Result:= lisMenuConfigureHelp;
     ecContextHelp            : Result:= lisMenuContextHelp;
Index: ide/main.pp
===================================================================
--- ide/main.pp	(revision 9954)
+++ ide/main.pp	(working copy)
@@ -1369,7 +1369,7 @@
 
   ButtonTop := 2;
   ButtonLeft := 2;
-  MainIDEBar.NewUnitSpeedBtn       := CreateButton('NewUnitSpeedBtn'      , 'btn_newunit'   , 1, ButtonLeft, ButtonTop, [mfLeft], @mnuNewUnitClicked, lisHintNewUnit);
+  MainIDEBar.NewUnitSpeedBtn       := CreateButton('NewUnitSpeedBtn'      , 'btn_newunit'   , 1, ButtonLeft, ButtonTop, [mfLeft], @mnuNewUnitClicked, lisMenuNewUnit);
 
   MainIDEBar.OpenFileSpeedBtn      := CreateButton('OpenFileSpeedBtn'     , 'btn_openfile'  , 1, ButtonLeft, ButtonTop, [mfLeft], @mnuOpenClicked, lisHintOpen);
 
@@ -1381,7 +1381,7 @@
 
   MainIDEBar.SaveSpeedBtn          := CreateButton('SaveSpeedBtn'         , 'btn_save'      , 2, ButtonLeft, ButtonTop, [mfLeft], @mnuSaveClicked, lisHintSave);
   MainIDEBar.SaveAllSpeedBtn       := CreateButton('SaveAllSpeedBtn'      , 'btn_saveall'   , 1, ButtonLeft, ButtonTop, [mfLeft], @mnuSaveAllClicked, lisHintSaveAll);
-  MainIDEBar.NewFormSpeedBtn       := CreateButton('NewFormSpeedBtn'      , 'btn_newform'   , 1, ButtonLeft, ButtonTop, [mfLeft], @mnuNewFormClicked, lisHintNewForm);
+  MainIDEBar.NewFormSpeedBtn       := CreateButton('NewFormSpeedBtn'      , 'btn_newform'   , 1, ButtonLeft, ButtonTop, [mfLeft], @mnuNewFormClicked, lisMenuNewForm);
   MainIDEBar.ToggleFormSpeedBtn    := CreateButton('ToggleFormSpeedBtn'   , 'btn_toggleform', 2, ButtonLeft, ButtonTop, [mfLeft, mfTop], @mnuToggleFormUnitCLicked, lisHintToggleFormUnit);
 
   // new row
Index: ide/lazarusidestrconsts.pas
===================================================================
--- ide/lazarusidestrconsts.pas	(revision 9954)
+++ ide/lazarusidestrconsts.pas	(working copy)
@@ -143,9 +143,8 @@
   lisMenuNewUnit = 'New Unit';
   lisMenuNewForm = 'New Form';
   lisMenuNewOther = 'New ...';
-  lisMenuOpen = 'Open';
+  lisMenuOpen = 'Open ...';
   lisMenuRevert = 'Revert';
-  lisOpen = 'Open ...';
   lisPkgEditPublishPackage = 'Publish Package';
   lisMenuOpenRecent = 'Open Recent ...';
   lisMenuSave = 'Save';
@@ -320,7 +319,6 @@
   lisMenuCodeToolsOptions = 'CodeTools Options ...';
   lisMenuCodeToolsDefinesEditor = 'CodeTools defines editor ...';
   
-  lisMenuAboutLazarus = 'About Lazarus ...';
   lisMenuOnlineHelp = 'Online Help';
   lisMenuConfigureHelp = 'Configure Help ...';
   lisMenuContextHelp = 'Context sensitive Help';
@@ -673,11 +671,9 @@
   lisCopyError = 'Copy Error';
 
   // hints
-  lisHintNewUnit = 'New Unit';
   lisHintOpen = 'Open';
   lisHintSave = 'Save';
   lisHintSaveAll = 'Save all';
-  lisHintNewForm = 'New Form';
   lisHintToggleFormUnit = 'Toggle Form/Unit';
   lisHintViewUnits = 'View Units';
   lisHintViewForms = 'View Forms';
@@ -1474,14 +1470,6 @@
   srkmecMoveEditorRight       = 'Move editor right';
   srkmecGotoEditor            = 'Go to editor %d';
 
-  // file menu
-  srkmecNew                   = 'New';
-  srkmecNewUnit               = 'New unit';
-  srkmecNewForm               = 'New form';
-  srkmecSaveAs                = 'Save as';
-  srkmecSaveAll               = 'Save all';
-  srkmecCloseAll              = 'Close all';
-
   // edit menu
   srkmecSelectionTabs2Spaces  = 'Convert tabs to spaces in selection';
   srkmecInsertCharacter       = 'Insert from Charactermap';
@@ -1677,6 +1665,7 @@
   rsLanguageJapanese    = 'Japanese';
   rsLanguageChinese     = 'Chinese';
   rsLanguageIndonesian  = 'Indonesian';
+  rsLanguageAfrikaans   = 'Afrikaans';
 
   // Unit dependencies
   dlgUnitDepCaption     = 'Unit dependencies';
@@ -3150,5 +3139,17 @@
 
   // version info tab
   VersionInfoTitle = 'Version Info';
+  
+  // Procedure List dialog
+  lisPListObjects               = '&Objects';
+  lisPListJumpToSelection       = 'Jump To Selection';
+  lisPListFilterAny             = 'Filter by matching any part of method';
+  lisPListFilterStart           = 'Filter by matching with start of method';
+  lisPListChangeFont            = 'Change Font';
+  lisPListCopyMethodToClipboard = 'Copy method name to the clipboard';
+  lisPListType                  = 'Type';
+  lisPListAll                   = '<All>';
+  lisPListNone                  = '<None>';
+
 implementation
 end.
Index: ide/procedurelist.pas
===================================================================
--- ide/procedurelist.pas	(revision 9954)
+++ ide/procedurelist.pas	(working copy)
@@ -115,27 +115,17 @@
   ,LazIDEIntf
   ,IDECommands
   ,Clipbrd
+  ,LazarusIDEStrConsts
   ;
 
 
 const
-  cProcedureList = 'ProcedureList';
   cAbout =
     'Procedure List (Lazarus addon)' + #10#10 +
     'Author: Graeme Geldenhuys  ([EMAIL PROTECTED])' + #10 +
     'Inspired by: GExperts  (www.gexperts.org)';
 
 
-resourcestring
-  SProcedureListCaption = 'Procedure List...';
-  SAllString            = '<All>';
-  SNoneString           = '<None>';
-  SUnknown              = 'Unknown';
-  SImplementationNotFound = 'Implementation section not found (parser error?)';
-  SObjects              = '&Objects';
-  SSearch               = '&Search';
-  
-  
 { This is where it all starts. Gets called from Lazarus. }
 procedure ExecuteProcedureList(Sender: TObject);
 var
@@ -263,10 +253,21 @@
 begin
   self.KeyPreview     := True;
   self.Position       := poDesktopCenter;
-  
-  lblObjects.Caption  := SObjects;
-  lblSearch.Caption   := SSearch;
 
+  // assign resource strings to Captions and Hints
+  self.Caption          := srkmecProcedureList;
+  lblObjects.Caption    := lisPListObjects;
+  lblSearch.Caption     := lisMenuSearch;
+  tbAbout.Hint          := lisMenuTemplateAbout;
+  tbJumpTo.Hint         := lisPListJumpToSelection;
+  tbFilterAny.Hint      := lisPListFilterAny;
+  tbFilterStart.Hint    := lisPListFilterStart;
+  tbChangeFont.Hint     := lisPListChangeFont;
+  tbCopy.Hint           := lisPListCopyMethodToClipboard;
+  LV.Column[1].Caption  := lisProcedure;
+  LV.Column[2].Caption  := lisPListType;
+  LV.Column[3].Caption  := lisToDoLLine;
+
   LV.Column[0].Width  := 20;
   LV.Column[1].Width  := 300;
   LV.Column[2].Width  := 100;
@@ -384,8 +385,8 @@
   lNodeText: string;
 begin
   cbObjects.Items.Clear;
-  cbObjects.Items.Add(SAllString);
-  cbObjects.Items.Add(SNoneString);
+  cbObjects.Items.Add(lisPListAll);
+  cbObjects.Items.Add(lisPListNone);
   try
     { get active source editor }
     lSrcEditor := SourceEditorWindow.ActiveEditor;
@@ -439,7 +440,7 @@
   lCaret: TCodeXYPosition;
   FSearchAll: boolean;
 begin
-  FSearchAll := cbObjects.Text = SAllString;
+  FSearchAll := cbObjects.Text = lisPListAll;
   lNodeText := pCodeTool.ExtractProcHead(pNode,
       [phpWithoutClassKeyword, phpWithoutParamList, phpWithoutBrackets,
        phpWithoutSemicolon, phpWithoutClassName]);
@@ -492,7 +493,7 @@
   begin
     { lets filter by class selection. }
     lClass := pCodeTool.ExtractClassNameOfProcNode(pNode);
-    if cbObjects.Text = SNoneString then
+    if cbObjects.Text = lisPListNone then
       Result := lClass = ''
     else
       Result := lClass = cbObjects.Text;
Index: packager/addtopackagedlg.pas
===================================================================
--- packager/addtopackagedlg.pas	(revision 9954)
+++ packager/addtopackagedlg.pas	(working copy)
@@ -743,15 +743,15 @@
   SaveDialog:=TSaveDialog.Create(nil);
   try
     InputHistories.ApplyFileDialogSettings(SaveDialog);
-    SaveDialog.InitialDir:=
+    SaveDialog.InitialDir :=
       LazPackage.GetFileDialogInitialDir(SaveDialog.InitialDir);
-    SaveDialog.Title:=srkmecSaveAs;
-    SaveDialog.Options:=SaveDialog.Options+[ofPathMustExist];
+    SaveDialog.Title := lisMenuSaveAs;
+    SaveDialog.Options := SaveDialog.Options+[ofPathMustExist];
     if SaveDialog.Execute then begin
-      AFilename:=CleanAndExpandFilename(SaveDialog.Filename);
+      AFilename := CleanAndExpandFilename(SaveDialog.Filename);
       if FilenameIsPascalUnit(AFilename) then begin
         LazPackage.ShortenFilename(AFilename,true);
-        ComponentUnitFileEdit.Text:=AFilename;
+        ComponentUnitFileEdit.Text := AFilename;
       end else begin
         MessageDlg(lisA2PInvalidFile,
          lisA2PAPascalUnitMustHaveTheExtensionPPOrPas,

Reply via email to