[haiku-development] Re: printf-convention BString filler

  • From: pulkomandy <pulkomandy@xxxxxxxxxxxxxxxxx>
  • To: <haiku-development@xxxxxxxxxxxxx>
  • Date: Thu, 24 Feb 2011 13:01:02 +0100


> Since the << operator is already used in BString, the suggested 
> BStringBuilder API cannot be used here, but I would personally prefer 
> methods over the << operator anyway.
> Other than that, I think it makes sense to have two different APIs for 
> that, even though I wouldn't mind if both of them end up in BString 
> eventually.

BStringBuilder would be a different class, like ostringstream is in plain
C++.

> 
> Other than that, as Ingo pointed out on the original thread
> (//www.freelists.org/post/haiku/Proposals-for-the-LocaleKit,
> 44), we still need a dedicated solution for numbering.
> It might be a good idea to look at the solutions in Qt, and Java for 
> this. The latter uses a choice formatter that the translator specified 
> similar to what Ingo suggested:
> {1,choice,0#zero,1#one,2#many}
> See
>
http://download.oracle.com/javase/1.4.2/docs/api/java/text/MessageFormat.html

... which uses ICU as a backend. Something we may use too :) (IIRC
somewhere around hte PluralFormat class.)


Other related posts: