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')