[haiku-bugs] Re: [Haiku] #5912: Devices localization patch

  • From: "stippi" <trac@xxxxxxxxxxxx>
  • Date: Mon, 24 May 2010 15:11:38 -0000

#5912: Devices localization patch
----------------------------------------+-----------------------------------
 Reporter:  Karvjorm                    |       Owner:  nobody   
     Type:  enhancement                 |      Status:  new      
 Priority:  normal                      |   Milestone:  R1       
Component:  Applications/Devices        |     Version:  R1/alpha1
 Keywords:  Devices localization patch  |    Platform:  All      
Blockedby:                              |       Patch:  1        
 Blocking:                              |  
----------------------------------------+-----------------------------------

Comment(by stippi):

 Why is there one fAppCatalog per translated file, additionally to the one
 allocated in main()? The patch also still contains translation-unfriendly
 string composition:

 {{{
 @@ -102,17 +132,21 @@
  Device::GetBasicStrings()
  {
         BString str;
 -       str << "Device Name\t\t\t\t: " << GetName() << "\n";
 -       str << "Manufacturer\t\t\t: " << GetManufacturer() << "\n";
 -       str << "Driver used\t\t\t\t: " << GetDriverUsed() << "\n";
 -       str << "Device paths\t: " << GetDevPathsPublished();
 +       str << B_TRANSLATE("Device Name");
 +       str << "\t\t\t\t: " << GetName() << "\n";
 +       str << B_TRANSLATE("Manufacturer");
 +       str << "\t\t\t: " << GetManufacturer() << "\n";
 +       str << B_TRANSLATE("Driver used");
 +       str << "\t\t\t\t: " << GetDriverUsed() << "\n";
 +       str << B_TRANSLATE("Device paths");
 +       str << "\t: " << GetDevPathsPublished();
         return str;
  }
 }}}

 This should be more like

 {{{
     BString string = B_TRANSLATE("Device Name\t\t\t\t: %1\n"
         "Manufacturer\t\t\t: %2\n"
         "Driver used\t\t\t\t: %3\n"
         "Device paths\t: %4\n");
     string.ReplaceFirst("%1", GetName());
     string.ReplaceFirst("%2", GetManufacturer());
     string.ReplaceFirst("%3", GetDriverUsed());
     string.ReplaceFirst("%4", GetDevPathsPublished());
     return string;
 }}}

 This way, a translation can change the order (think bottom to top
 languages) and the number of tabs can be adjusted for the actual string
 widths, so that the alignment can be preserved.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/5912#comment:6>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: