[wp-trac] [WordPress Trac] #3687: translatable strings descriptions

WordPress Trac wp-trac at lists.automattic.com
Fri Jan 26 13:27:41 GMT 2007


#3687: translatable strings descriptions
-------------------------+--------------------------------------------------
 Reporter:  nbachiyski   |       Owner:  anonymous     
     Type:  enhancement  |      Status:  new           
 Priority:  normal       |   Milestone:  2.2           
Component:  General      |     Version:                
 Severity:  normal       |    Keywords:  i18n has-patch
-------------------------+--------------------------------------------------
 '''The problems:'''
  * gettext doesn't provide support for strings disambiguations - one one
 the same words could be used in different contexts with different
 meanings, however the translation is only one
  * a description cannot be attached to a translatable string - consider
 the string {{{the $1%s $1%s}}}. If the translator doesn't take the time to
 dig into the code, one couldn't translate it properly

 '''A sample solution:'''

 We could introduce a new function {{{__withdesc()}}}, which works like
 {{{__()}}}, but strips all the text from the translation after the first
 {{{|}}} character. Thus, we could provide descriptions to translators and
 prevent string ambiguities.\

 Here are some examples:
  * {{{__withdesc('Editor|role')}}} and {{{__withdesc('Editor|rich-text
 textarea')}}} - we had this problem some time ago
  * {{{__withdesc('%1$s – %2$s|1: date, 2: time')}}}

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3687>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list