View Issue Details

IDProjectCategoryView StatusLast Update
0029103LazarusPackagespublic2015-12-06 10:46
ReporterPéter GáborAssigned ToOndrej Pokorny 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.5 (SVN)Product Build 
Target VersionFixed in Version1.6 
Summary0029103: favorites: patch to support localization
DescriptionSee attachment
TagsNo tags attached.
Fixed in Revision50521
LazTarget-
Widgetset
Attached Files
  • favorites_localize.diff (4,628 bytes)
    Index: components/favorites/favorites.lpk
    ===================================================================
    --- components/favorites/favorites.lpk	(revision 50515)
    +++ components/favorites/favorites.lpk	(working copy)
    @@ -9,6 +9,7 @@
           <Version Value="11"/>
           <PathDelim Value="\"/>
           <SearchPaths>
    +        <OtherUnitFiles Value="."/>
             <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
           </SearchPaths>
           <CodeGeneration>
    @@ -30,13 +31,22 @@
         <Description Value="Creates a third section (on the top) in the Open tool button drop-down menu where you can register your favorite projects."/>
         <License Value="GPL-2"/>
         <Version Minor="1" Release="1"/>
    -    <Files Count="1">
    +    <Files Count="2">
           <Item1>
             <Filename Value="favorites_impl.pas"/>
             <HasRegisterProc Value="True"/>
             <UnitName Value="favorites_impl"/>
           </Item1>
    +      <Item2>
    +        <Filename Value="favoritesstr.pas"/>
    +        <UnitName Value="favoritesstr"/>
    +      </Item2>
         </Files>
    +    <i18n>
    +      <EnableI18N Value="True"/>
    +      <OutDir Value="languages"/>
    +      <EnableI18NForLFM Value="True"/>
    +    </i18n>
         <RequiredPkgs Count="2">
           <Item1>
             <PackageName Value="IDEIntf"/>
    Index: components/favorites/favorites.pas
    ===================================================================
    --- components/favorites/favorites.pas	(revision 50515)
    +++ components/favorites/favorites.pas	(working copy)
    @@ -7,7 +7,7 @@
     interface
     
     uses
    -  favorites_impl, LazarusPackageIntf;
    +  favorites_impl, favoritesstr, LazarusPackageIntf;
     
     implementation
     
    Index: components/favorites/favorites_impl.pas
    ===================================================================
    --- components/favorites/favorites_impl.pas	(revision 50515)
    +++ components/favorites/favorites_impl.pas	(working copy)
    @@ -32,7 +32,8 @@
     uses
       Classes, SysUtils, ToolBarIntf, IDEImagesIntf, Graphics, PackageIntf,
       Menus, LazIDEIntf, ProjectIntf, Laz2_XMLCfg, IDEOptionsIntf,
    -  IDECommands, ComCtrls;
    +  IDECommands, ComCtrls, IDEMsgIntf,
    +  favoritesstr;
     
     type
       TFavoritesHandler = class
    @@ -164,9 +165,9 @@
         xAddToFav := TFileNameMenuItem.Create(Self);
         xAddToFav.FileName := xProj.ProjectInfoFile;
         if not FavHandler.IsInFavoriteProjects(xProj.ProjectInfoFile) then
    -      xAddToFav.Caption := Format('Add to favorites: %s', [xProj.ProjectInfoFile]) // To-Do: localize
    +      xAddToFav.Caption := Format(sAddToFavoritesS, [xProj.ProjectInfoFile])
         else
    -      xAddToFav.Caption := Format('Remove from favorites: %s', [xProj.ProjectInfoFile]); // To-Do: localize
    +      xAddToFav.Caption := Format(sRemoveFromFavoritesS, [xProj.ProjectInfoFile]);
         xAddToFav.OnClick := @mnuAddRemoveActiveProject;
         xM.Insert(xMIndex, xAddToFav);
         Inc(xMIndex);
    Index: components/favorites/favoritesstr.pas
    ===================================================================
    --- components/favorites/favoritesstr.pas	(revision 0)
    +++ components/favorites/favoritesstr.pas	(working copy)
    @@ -0,0 +1,13 @@
    +unit favoritesstr;
    +
    +{$mode objfpc}{$H+}
    +
    +interface
    +
    +resourcestring
    +  sAddToFavoritesS = 'Add to favorites: %s';
    +  sRemoveFromFavoritesS = 'Remove from favorites: %s';
    +
    +implementation
    +
    +end.
    Index: components/favorites/languages/favoritesstr.po
    ===================================================================
    --- components/favorites/languages/favoritesstr.po	(revision 0)
    +++ components/favorites/languages/favoritesstr.po	(working copy)
    @@ -0,0 +1,11 @@
    +msgid ""
    +msgstr "Content-Type: text/plain; charset=UTF-8"
    +
    +#: favoritesstr.saddtofavoritess
    +msgid "Add to favorites: %s"
    +msgstr ""
    +
    +#: favoritesstr.sremovefromfavoritess
    +msgid "Remove from favorites: %s"
    +msgstr ""
    +
    Index: components/favorites/languages/favoritesstr.hu.po
    ===================================================================
    --- components/favorites/languages/favoritesstr.hu.po	(revision 0)
    +++ components/favorites/languages/favoritesstr.hu.po	(working copy)
    @@ -0,0 +1,20 @@
    +msgid ""
    +msgstr ""
    +"Project-Id-Version: \n"
    +"POT-Creation-Date: \n"
    +"PO-Revision-Date: \n"
    +"Last-Translator: Péter Gábor <ptrg@freemail.hu>\n"
    +"Language-Team: Magyar (Hungarian)\n"
    +"Language: hu\n"
    +"MIME-Version: 1.0\n"
    +"Content-Type: text/plain; charset=UTF-8\n"
    +"Content-Transfer-Encoding: 8bit\n"
    +"X-Generator: Poedit 1.5.4\n"
    +
    +#: favoritesstr.saddtofavoritess
    +msgid "Add to favorites: %s"
    +msgstr "Hozzáadás a kedvencekhez: %s"
    +
    +#: favoritesstr.sremovefromfavoritess
    +msgid "Remove from favorites: %s"
    +msgstr "Eltávolítás a kedvencek közül: %s"
    
    favorites_localize.diff (4,628 bytes)

Activities

Péter Gábor

2015-11-27 20:12

reporter  

favorites_localize.diff (4,628 bytes)
Index: components/favorites/favorites.lpk
===================================================================
--- components/favorites/favorites.lpk	(revision 50515)
+++ components/favorites/favorites.lpk	(working copy)
@@ -9,6 +9,7 @@
       <Version Value="11"/>
       <PathDelim Value="\"/>
       <SearchPaths>
+        <OtherUnitFiles Value="."/>
         <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
       </SearchPaths>
       <CodeGeneration>
@@ -30,13 +31,22 @@
     <Description Value="Creates a third section (on the top) in the Open tool button drop-down menu where you can register your favorite projects."/>
     <License Value="GPL-2"/>
     <Version Minor="1" Release="1"/>
-    <Files Count="1">
+    <Files Count="2">
       <Item1>
         <Filename Value="favorites_impl.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="favorites_impl"/>
       </Item1>
+      <Item2>
+        <Filename Value="favoritesstr.pas"/>
+        <UnitName Value="favoritesstr"/>
+      </Item2>
     </Files>
+    <i18n>
+      <EnableI18N Value="True"/>
+      <OutDir Value="languages"/>
+      <EnableI18NForLFM Value="True"/>
+    </i18n>
     <RequiredPkgs Count="2">
       <Item1>
         <PackageName Value="IDEIntf"/>
Index: components/favorites/favorites.pas
===================================================================
--- components/favorites/favorites.pas	(revision 50515)
+++ components/favorites/favorites.pas	(working copy)
@@ -7,7 +7,7 @@
 interface
 
 uses
-  favorites_impl, LazarusPackageIntf;
+  favorites_impl, favoritesstr, LazarusPackageIntf;
 
 implementation
 
Index: components/favorites/favorites_impl.pas
===================================================================
--- components/favorites/favorites_impl.pas	(revision 50515)
+++ components/favorites/favorites_impl.pas	(working copy)
@@ -32,7 +32,8 @@
 uses
   Classes, SysUtils, ToolBarIntf, IDEImagesIntf, Graphics, PackageIntf,
   Menus, LazIDEIntf, ProjectIntf, Laz2_XMLCfg, IDEOptionsIntf,
-  IDECommands, ComCtrls;
+  IDECommands, ComCtrls, IDEMsgIntf,
+  favoritesstr;
 
 type
   TFavoritesHandler = class
@@ -164,9 +165,9 @@
     xAddToFav := TFileNameMenuItem.Create(Self);
     xAddToFav.FileName := xProj.ProjectInfoFile;
     if not FavHandler.IsInFavoriteProjects(xProj.ProjectInfoFile) then
-      xAddToFav.Caption := Format('Add to favorites: %s', [xProj.ProjectInfoFile]) // To-Do: localize
+      xAddToFav.Caption := Format(sAddToFavoritesS, [xProj.ProjectInfoFile])
     else
-      xAddToFav.Caption := Format('Remove from favorites: %s', [xProj.ProjectInfoFile]); // To-Do: localize
+      xAddToFav.Caption := Format(sRemoveFromFavoritesS, [xProj.ProjectInfoFile]);
     xAddToFav.OnClick := @mnuAddRemoveActiveProject;
     xM.Insert(xMIndex, xAddToFav);
     Inc(xMIndex);
Index: components/favorites/favoritesstr.pas
===================================================================
--- components/favorites/favoritesstr.pas	(revision 0)
+++ components/favorites/favoritesstr.pas	(working copy)
@@ -0,0 +1,13 @@
+unit favoritesstr;
+
+{$mode objfpc}{$H+}
+
+interface
+
+resourcestring
+  sAddToFavoritesS = 'Add to favorites: %s';
+  sRemoveFromFavoritesS = 'Remove from favorites: %s';
+
+implementation
+
+end.
Index: components/favorites/languages/favoritesstr.po
===================================================================
--- components/favorites/languages/favoritesstr.po	(revision 0)
+++ components/favorites/languages/favoritesstr.po	(working copy)
@@ -0,0 +1,11 @@
+msgid ""
+msgstr "Content-Type: text/plain; charset=UTF-8"
+
+#: favoritesstr.saddtofavoritess
+msgid "Add to favorites: %s"
+msgstr ""
+
+#: favoritesstr.sremovefromfavoritess
+msgid "Remove from favorites: %s"
+msgstr ""
+
Index: components/favorites/languages/favoritesstr.hu.po
===================================================================
--- components/favorites/languages/favoritesstr.hu.po	(revision 0)
+++ components/favorites/languages/favoritesstr.hu.po	(working copy)
@@ -0,0 +1,20 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"POT-Creation-Date: \n"
+"PO-Revision-Date: \n"
+"Last-Translator: Péter Gábor <ptrg@freemail.hu>\n"
+"Language-Team: Magyar (Hungarian)\n"
+"Language: hu\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.4\n"
+
+#: favoritesstr.saddtofavoritess
+msgid "Add to favorites: %s"
+msgstr "Hozzáadás a kedvencekhez: %s"
+
+#: favoritesstr.sremovefromfavoritess
+msgid "Remove from favorites: %s"
+msgstr "Eltávolítás a kedvencek közül: %s"
favorites_localize.diff (4,628 bytes)

Ondrej Pokorny

2015-11-28 21:44

reporter   ~0087669

Applied! Thanks, Péter!

Issue History

Date Modified Username Field Change
2015-11-27 20:12 Péter Gábor New Issue
2015-11-27 20:12 Péter Gábor File Added: favorites_localize.diff
2015-11-28 19:05 Ondrej Pokorny Assigned To => Ondrej Pokorny
2015-11-28 19:05 Ondrej Pokorny Status new => assigned
2015-11-28 20:54 Ondrej Pokorny Fixed in Revision => 50521
2015-11-28 20:54 Ondrej Pokorny LazTarget => -
2015-11-28 20:54 Ondrej Pokorny Status assigned => resolved
2015-11-28 20:54 Ondrej Pokorny Fixed in Version => 1.6
2015-11-28 20:54 Ondrej Pokorny Resolution open => fixed
2015-11-28 21:44 Ondrej Pokorny Note Added: 0087669
2015-12-06 10:46 Péter Gábor Status resolved => closed