Sfoglia il codice sorgente

* apt-pkg/contrib/strutl.cc:
- add a space between number and unit as required by SI (Closes: #598352)

David Kalnischkies 16 anni fa
parent
commit
4d8d8112bb
3 ha cambiato i file con 17 aggiunte e 3 eliminazioni
  1. 2 2
      apt-pkg/contrib/strutl.cc
  2. 12 0
      cmdline/apt-get.cc
  3. 3 1
      debian/changelog

+ 2 - 2
apt-pkg/contrib/strutl.cc

@@ -340,13 +340,13 @@ string SizeToStr(double Size)
    {
       if (ASize < 100 && I != 0)
       {
-         sprintf(S,"%'.1f%c",ASize,Ext[I]);
+         sprintf(S,"%'.1f %c",ASize,Ext[I]);
 	 break;
       }
       
       if (ASize < 10000)
       {
-         sprintf(S,"%'.0f%c",ASize,Ext[I]);
+         sprintf(S,"%'.0f %c",ASize,Ext[I]);
 	 break;
       }
       ASize /= 1000.0;

+ 12 - 0
cmdline/apt-get.cc

@@ -1106,17 +1106,25 @@ bool InstallPackages(CacheFile &Cache,bool ShwKept,bool Ask = true,
    
    // Number of bytes
    if (DebBytes != FetchBytes)
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("Need to get %sB/%sB of archives.\n"),
 	       SizeToStr(FetchBytes).c_str(),SizeToStr(DebBytes).c_str());
    else if (DebBytes != 0)
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("Need to get %sB of archives.\n"),
 	       SizeToStr(DebBytes).c_str());
 
    // Size delta
    if (Cache->UsrSize() >= 0)
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("After this operation, %sB of additional disk space will be used.\n"),
 	       SizeToStr(Cache->UsrSize()).c_str());
    else
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("After this operation, %sB disk space will be freed.\n"),
 	       SizeToStr(-1*Cache->UsrSize()).c_str());
 
@@ -2340,9 +2348,13 @@ bool DoSource(CommandLine &CmdL)
    
    // Number of bytes
    if (DebBytes != FetchBytes)
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("Need to get %sB/%sB of source archives.\n"),
 	       SizeToStr(FetchBytes).c_str(),SizeToStr(DebBytes).c_str());
    else
+      //TRANSLATOR: The required space between number and unit is already included
+      // in the replacement string, so %sB will be correctly translate in e.g. 1,5 MB
       ioprintf(c1out,_("Need to get %sB of source archives.\n"),
 	       SizeToStr(DebBytes).c_str());
    

+ 3 - 1
debian/changelog

@@ -4,8 +4,10 @@ apt (0.8.6) UNRELEASED; urgency=low
   * cmdline/apt-cache.cc:
     - use the TranslatedDescription for searching and not the first
       available one as it is maybe not an expected language (Closes: #597925)
+  * apt-pkg/contrib/strutl.cc:
+    - add a space between number and unit as required by SI (Closes: #598352)
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 24 Sep 2010 14:11:52 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Tue, 28 Sep 2010 17:25:22 +0200
 
 apt (0.8.5) unstable; urgency=low