[buddypress-trac] [BuddyPress] #1222: Message excerpts don't work on inbox/sentbox under i18n environment

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Tue Dec 28 20:57:53 UTC 2010

#1222: Message excerpts don't work on inbox/sentbox under i18n environment
  Reporter:  takuya  |      Owner:
      Type:  defect  |     Status:  new
  Priority:  normal  |  Milestone:  1.3
 Component:  Core    |    Version:
Resolution:          |   Keywords:  i18n,excerpt,needs-patch
Changes (by boonebgorges):

 * priority:  major => normal
 * component:   => Core


 The problem appears to be with the way that Asian languages use spaces.
 bp_create_excerpt() creates an excerpt and attempts not to break any words
 in half, and it does this by assuming that words correspond to the
 characters that appear between spaces or punctuation. When a language has
 sentences that are 40 or 50 characters long, bp_create_excerpt()
 interprets it as a single word. Thus, when bp_create_excerpt() attempts to
 truncate the text to 10 words (as in the case of message excerpts), it
 ends up making an excerpt of 10 whole sentences, which in many cases is
 the entire message.

 One solution is for the value of $excerpt_length to be interpreted in
 characters rather than in words. We'd still probably use a space as a
 delimiter to ensure that words (in alphabetic languages) don't get split
 in half, but instead of always having an excerpt of 10 words, it'd be an
 except of (say) 75 letters, rounded up to the nearest space. This might
 break some plugins currently using bp_create_excerpt() with a specific
 value for $excerpt_length.

 Before writing a patch, I would like to get feedback from someone with
 more knowledge of l18n best practices.

 Bumping the ticket priority down because this problem can be worked around
 by filtering 'bp_create_excerpt' or 'bp_get_message_thread_excerpt'.

Ticket URL: <http://trac.buddypress.org/ticket/1222#comment:3>
BuddyPress <http://buddypress.org/>

More information about the buddypress-trac mailing list