[haiku-bugs] Re: [Haiku] #7530: [Cortex] Cortex is not localized

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Tue, 05 Feb 2013 17:43:27 -0000

#7530: [Cortex] Cortex is not localized
-----------------------------------+----------------------------
   Reporter:  deejam               |      Owner:  pulkomandy
       Type:  enhancement          |     Status:  assigned
   Priority:  normal               |  Milestone:  R1
  Component:  Applications/Cortex  |    Version:  R1/Development
 Resolution:                       |   Keywords:
 Blocked By:                       |   Blocking:
Has a Patch:  1                    |   Platform:  All
-----------------------------------+----------------------------

Comment (by pulkomandy):

 Quick look at the patch:

 {{{
 64                  setSideBarWidth(be_plain_font->StringWidth("
 Destination ")
         69
 setSideBarWidth(be_plain_font->StringWidth(B_TRANSLATE("Destination"))
 }}}

 This makes the view narrower than before. Does it still look ok ? There's
 already a margin added to it, but maybe it needs to be increased. There
 are other places where the same thing happens again.

 {{{
 141                         setSideBarWidth(be_plain_font->StringWidth("
 Video Data Between ") + 2 * InfoView::M_H_MARGIN);
         146
 setSideBarWidth(be_plain_font->StringWidth(B_TRANSLATE(" Video data
 between ")) + 2 * InfoView::M_H_MARGIN);
 }}}

 You removed the spaces in other cases, why keep them here ? Try to be
 consistent. (remove the spaces everywhere, and adjust the margins, or
 possibly add the spaces after localisation)


 {{{
 118                         addField("Format", s);
         123                 addField(B_TRANSLATE("Format"), s);
 }}}

 (and all addField calls): it seems this method will do something like arg1
 + ": " + arg2. This is not locale safe.


 {{{
 120                                         s << "\n- Codec: " <<
 codec.pretty_name;
         124                                 s << B_TRANSLATE("\n- Codec:
 ") << codec.pretty_name;
 121     125                                 if (codec.id > 0)
 122     126                                 {
 123                                             s << " (ID: " << codec.id
 << ")";
         127                                     s << B_TRANSLATE(" (ID: ")
 << codec.id << ")";
 124     128                                 }
 }}}

 {{{
 179                 title << " info";
         184         title << B_TRANSLATE(" info");
 }}}

 (and some other places)

 Do not use the << operator this way. The translator should see a string
 like this:
 'Codec: %codec% (ID: %id%)" with a comment saying that the ID part may be
 removed.
 Use BString.ReplaceFirst to replace the %% tags with the proper values,
 after calling B_TRANSLATE.


 {{{
         414     const char* const
 NodeManager::s_defaultGroupPrefix = B_TRANSLATE("No name");
         415     const char* const           NodeManager::s_timeSourceGroup
 = B_TRANSLATE("Time sources");
         416     const char* const           NodeManager::s_audioInputGroup
 = B_TRANSLATE("System audio input");
         417     const char* const           NodeManager::s_videoInputGroup
 = B_TRANSLATE("System video input");
         418     const char* const           NodeManager::s_audioMixerGroup
 = B_TRANSLATE("System audio mixer");
         419     const char* const
 NodeManager::s_videoOutputGroup = B_TRANSLATE("System video output");
 }}}

 You can't use B_TRANSLATE on const char* const, since the string is not a
 constant anymore. You have to use B_TRANSLATE_MARK to tag the string for
 collectcatkeys, then use B_TRANSLATE on the constant, everywhere it is
 actually used. This does not even compile, so I suspect the patch wasn't
 tested ?


 {{{
         92              sprintf(title, B_TRANSLATE("%s parameters"),
 nodeInfo.name);
 }}}

 Same as the << operator, use ReplaceFirst instead, or use
 B_TRANSLATE_COMMENT to inform the translator what the %s is replaced with.
 When there are multiple % escapes in a string used in printf family
 function, switch to ReplaceFirst, because the tokens may be in a different
 order in the translated string and that will confuse printf.


 You added HAIKU_LOCALE_LIBS to each .a archive built. You only need it
 once for the application.
 You also added a separate DoCatalogs invocation for each of the add-ons.
 I'm not sure that's the right thing to do. We could have the add-on load
 their strings from the application catalog, since they can't be used
 anywhere else (so there are less catalog files). That requires some
 additional jam and C++ tricks, however.

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

Other related posts: