[haiku-development] Coding Guidelines need update for localization

  • From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Thu, 22 Jul 2010 15:22:46 +0200

Hello devs,
following some discussions with translators, I think some update to the 
coding guidelines are needed for easier internationalization of Haiku.

Here it is, I'd like to know your advice, before it gets added to the 
actual online coding guideline reference.

Avoid using << and similar methods for building a localized string.

Instead of : BString s << total << "MiB total, " << free << "MiB free."
do : BString s("%t MiB total, %f MiB free); s.ReplaceFirst("%t",total); 
s.ReplaceFirst("%f", free);

There are likely some other rules, for example 
. But I'm not sure these are easily localizable...

Other related posts: